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 |
|
A group of steps that run in the workflow. By default, jobs are run in parallel. Also, job usage is limited to 4G memory and 4000m CPU (4 vCPUs). |
|
Multiple jobs in a workflow can be run sequentially, by specifying the name, in |
|
Steps are activities that occur in series within a workflow job. Containerized custom scripts or action calls are common step examples. Steps execute:
|
|
(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. |
Ensure that your workflow and action code do not execute untrusted input. Use the following recommendations to harden your code against attackers:
|