5.5 Jobs

Jobs determine the actions of your pipeline, how resources progress through it, and how everything is visualized. They are listed under the jobs key in the pipeline configuration.

The most important attribute of a job is its build plan, configured as plan. This determines the sequence of Steps to execute in any builds of the job.

name: string

Required. The name of the job. This should be short; it will show up in URLs.

plan: [step]

Required. The sequence of steps to execute.

serial: boolean

Optional. Default false. If set to true, builds will queue up and execute one-by-one, rather than executing in parallel.

Optional. If configured, only the last specified number of builds will have their build logs persisted. This is useful if you have a job that runs periodically but after some amount of time the logs aren't worth keeping around.


- name: smoke-tests
  build_logs_to_retain: 100
  - get: 10m
  - task: smoke-tests
    # ...
serial_groups: [string]

Optional. Default []. When set to an array of arbitrary tag-like strings, builds of this job and other jobs referencing the same tags will be serialized.

This can be used to ensure that certain jobs do not run at the same time, like so:

- name: job-a
  serial_groups: [some-tag]
- name: job-b
  serial_groups: [some-tag, some-other-tag]
- name: job-c
  serial_groups: [some-other-tag]

In this example, job-a and job-c can run concurrently, but neither job can run builds at the same time as job-b.

The builds are executed in their order of creation, across all jobs with common tags.

max_in_flight: integer

Optional. If set, specifies a maximum number of builds to run at a time. If serial or serial_groups are set, they take precedence and force this value to be 1.

public: boolean

Optional. Default false. If set to true, the build log of this job will be viewable by unauthenticated users. Unauthenticated users will always be able to see the inputs, outputs, and build status history of a job. This is useful if you would like to expose your pipeline publicly without showing sensitive information in the build log.

Optional. Default false. If set to true, manual triggering of the job (via the web UI or fly trigger-job) will be disabled.

interruptible: boolean

Optional. Default false. Normally, when a worker is shutting down it will wait for builds with containers running on that worker to finish before exiting. If this value is set to true, the worker will not wait on the builds of this job. You may want this if e.g. you have a self-deploying Concourse or long-running-but-low-importance jobs.

on_success: step

Optional. Step to execute when the job succeeds. Equivalent to the on_success step attribute.

on_failure: step

Optional. Step to execute when the job fails. Equivalent to the on_failure step attribute.

on_abort: step

Optional. Step to execute when the job aborts. Equivalent to the on_abort step attribute.

ensure: step

Optional. Step to execute regardless of whether the job succeeds, fails, errors, or aborts. Equivalent to the ensure step attribute.

  1. Steps
    1. get step
    2. put step
    3. task step
    4. aggregate step
    5. do step
    6. try step
    7. on_success step hook
    8. on_failure step hook
    9. on_abort step hook
    10. ensure step hook
    11. tags step modifier
    12. timeout step modifier
    13. attempts step modifier
  2. Managing Jobs
    1. fly jobs
    2. fly trigger-job
    3. fly pause-job
    4. fly unpause-job
    5. fly clear-task-cache