CloudBees workflows are DevOps automations that run one or more jobs.
Define each workflow by a YAML file in a .cloudbees/workflows
directory in your repository.
Your repository can have multiple workflows, each of which can perform a different set of tasks. For example, you can have one workflow to build and test pull requests, and another workflow to build and deploy your application.
If a particular task in a workflow is to be reused, you can save it as an action. Both unique scripts and actions can be used together in any workflow.
Workflow minimum requirements
The minimum requirement for a workflow is as follows:
-
A repository event to trigger the workflow.
-
At least one job composed of at least one step.
-
A job step must contain either a script that you define, or a predefined action.
Workflow keywords and parts
Refer to An example workflow to understand how each keyword or part is used in a workflow. Refer to specific actions in CloudBees actions for other workflow keywords. |
Keyword or part | Definition |
---|---|
|
Specifies the CloudBees DSL syntax version, for example, |
|
Specifies the kind of CloudBees DSL file, for example, |
|
|
Event |
A repository commit, or creation of a pull request. An event triggers a workflow to start. |
|
Groups all repository events that can trigger a workflow to start. |
|
Defines a list of local properties.
Each property is a key / value pair.
The location of |
|
Groups all the jobs that run in the workflow. Each job consists of a series of steps. By default, multiple jobs run in parallel. |
|
Multiple jobs in a workflow can be run sequentially, by specifying the name, in |
|
Groups all the steps in a job. |
Step |
An activity that occurs in series within a job, and runs in a dedicated container. A step can be a custom script or a command to call an action. Steps have the following characteristics:
|
|
(Optional) The step ID. Subsequent steps can refer to outputs produced by this step by using its ID, for example, |
Action |
A saved script that performs a task, and increases coding efficiency by its reuse in workflows. For more information, refer to CloudBees actions. |
|
Within a step, specifies an action to use, or where a custom script is to be run. For example:
|
|
Specifies the shell used to run a step command. |
|
Specifies a command to run in a step. |
|
Groups all parameters a step uses during execution. Each parameter is a key / value pair. |
|
Groups all job outputs, and makes them available to downstream jobs. Each output is a key / value pair. |