Jobs are how you define what happens in every build. Every job configuration must consist of an
image and a list of
steps, or a
template. It also defines trigger requirement for the job using
requires. See workflow for detailed usage of
requires to create pipeline workflow.
jobs: main: image: node:6 steps: - init: npm install - test: npm test main2: template: example/mytemplate@stable
image configuration refers to a docker image, e.g. an container from hub.docker.com. You can specify an image from a custom registry by specifying the full url to that image.
jobs: main: image: my-custom-registry.example.com/myorg/myimage:label steps: - step1: echo hello
Steps are the list of instructions you want to execute in your build. These should be defined as:
step_name: step_command. Steps will be executed in the order they are defined.
jobs: main: image: node:8 steps: - step_name: step_command --arg1 --arg2 foo - greet: echo Hello
shared configuration is a special job configuration section that is applied to all jobs. Configuration that is specified in a job configuration will override the same configuration in
The following example defines a shared configuration for
steps, which is used by the main and main2 jobs.
shared: image: node:8 steps: - init: npm install - test: npm test jobs: main: image: node:6 main2: steps: - greet: echo hello
The above example would be equivalent to:
jobs: main: image: node:6 steps: - init: npm install - test: npm test main2: image: node:8 steps: - greet: echo hello
- Annotations - Freeform key/value store, often used to configure build execution settings
- Environment - Define environment variables for jobs
- Secrets - Securely pass secrets as environment variables into the build
- Settings - Define configuration of build plugins
- Templates - Common, community supported job configurations
- Workflow - Define the path of the pipeline