2.2 Serial job example

Setting the job.serial flag restricts a job to run one build at a time.

By default, jobs are run in parallel. For some use cases this might be ideal (ex. testing all incoming commits from a repository). For other use cases this might be less ideal (ex. deploying an application).

You can also set the job.max_in_flight value to 1 to disable parallel job runs.

Pipeline Configuration

---
jobs:
# Try to trigger the job multiple times and see what happens
- name: serial-job
  public: true
  serial: true
  plan:
  - task: simple-task
    config:
      platform: linux
      image_resource:
        type: registry-image
        source: { repository: busybox }
      run:
        path: echo
        args: ["Hello, world!"]

References