Automate development with CloudBees platform workflows. Workflows are configurable processes, defined in a YAML file, which run jobs. Trigger your workflow by an event in your integrated repository, a manual step, or a defined schedule.
Refer to the following for detailed information on scripting a workflow YAML:
Access a workflow
To access a workflow:
-
Select the next to Select a component, and then select a component.
-
Select the next to Components on the left pane, and then select Workflows.
-
(Optional) Select the next to Rows per page to display more workflows, or select the to advance to the next page.
-
(Optional) Choose one of the following:
-
Select a workflow name to display the workflow file.
-
Select EDIT YAML to update the workflow.
-
Select CREATE WORKFLOW to create a new workflow.
-
You are displaying workflows for your component, listed in alphabetical order.
Create and save a workflow
Create any number of workflows using the workflow composer. Switch at any time between the visual tool and the code editor to compose or update your workflow.
To save your workflow, you must make a commit to your repository, on either the current branch or a new branch. At this time, you cannot open a pull request to merge to the default branch. |
To create and save a workflow:
-
Select the next to Select a component, and then select a component.
-
Select Workflows.
-
Select CREATE WORKFLOW to display a default workflow.
Figure 1. Default workflow in the visual tool and code editor. -
Use either the visual tool and YAML scripting, or both together, to compose your workflow. Updates made with either the visual tool or the code editor are automatically displayed in both.
-
Select VISUAL to display only the visual tool.
-
Select SCRIPT to display only the code editor.
-
Select SPLIT to display both the visual tool and the code editor.
When SPLIT is active, select to arrange the visual tool above the code editor, or select to arrange the visual tool and code editor side by side.
-
-
Select COMMIT.
-
Enter a Commit message.
-
Select either of the following:
-
Commit to the current branch.
-
Commit to a new branch and enter a branch name.
-
-
Select FINISH.
Figure 2. Committing to a new branch, with FINISH highlighted. -
Check your repository for the commit.
All CloudBees platform workflows for your component are saved in .cloudbees/workflows
in the connected repository.Figure 3. Commit in the connected GitHub repository.
Your workflow is created and listed in Workflows.
Use the workflow composer visual tool
The visual tool enables you to compose and update a workflow using the UI. Any changes in the visual tool are reflected in the YAML script.
As highlighted above, use the visual tool to perform the following activities:
-
Switch the repository branch.
-
Select settings to update the workflow name and input any
env
key/value pairs. -
Select JOB to add a job.
-
Select the to update the trigger.
-
Select the to update a job or add a step.
-
Slide to expand or shrink the workflow display size.
Update the workflow trigger
To update the workflow push
trigger:
-
Select the next to
push
. -
Select Edit.
-
Select Branches, and then do one or more of the following:
-
Select any of the existing branches.
-
Enter a new branch name.
-
Enter
**
, for any branch name. -
Select the next to a branch to remove it.
-
-
Select SAVE.
The workflow push
trigger is updated accordingly.
Add a job
In the following example, selecting JOB and adding the job details creates a new job.
needs
input highlighted.-
The
MavenBuild
job requires theCheckout
job to run successfully first. To specify that a job must complete before another runs, either select ADD NEEDS or drag the job to the correct position in the visual tool.
Add a step to a job
To add a step to a job:
-
Select the next to your job, and then select Edit.
-
Select ADD STEP.
-
(Optional) Enter a step name.
-
Do either of the following:
-
Choose SELECT FROM CATALOG to add a preconfigured action, action, or container, which opens the list of actions and containers.
-
Enter an action or container to Uses.
Figure 7. Example of searching, with selection and APPLY SELECTED highlighted.
-
-
Enter any required inputs that are not already pre-populated. Inputs marked with an are required.
Figure 8. Required inputs entered for Snyk SCA scan action. -
(Optional) Select from the Kind options.
Figure 9. Scanning step with Scan kind selected.Select an appropriate Kind option (other than None) to associate the data from this step for analytics calculations. If the Kind option is inappropriate for the step, the data are not counted.
-
Select Deploy to use DORA metrics.
-
Select Build to use Software delivery activity.
-
Select Scan to use Security insights.
-
Test-related metrics are coming soon.
-
-
Select SAVE.
The step is added to the workflow job in the code editor and in the visual tool.
Use the workflow composer code editor
Input your workflow script directly into the code editor. Cut, copy, and paste as you would in any code editor. You can also undo and redo input.
Use the correct YAML indentation according to the specifications. Any invalid YAML is highlighted with a wavy underline.
Update a workflow
Update your workflow with either the visual tool or the code editor in the composer.
To update a workflow:
-
Select a component.
-
Select the next to Components on the left pane, and then select Workflows.
-
Select EDIT YAML next to a workflow.
-
Make any desired changes with either the visual tool or the code editor.
-
Select COMMIT.
-
Enter a Commit message.
-
Select a branch to commit from the options.
-
Select FINISH.
-
Check your repository for the commit. Your workflow is updated accordingly and the changes are committed to your repository, triggering a workflow run.
Delete a workflow
Delete any of your workflows. A deleted workflow is completely removed from the CloudBees platform, and deletion is irreversible.
To delete a workflow:
-
Select a component.
-
Select the next to Components on the left pane, and then select Workflows.
-
Select the workflow link.
-
Select the next to the workflow filename.
-
Select Delete.
-
Select CONFIRM.
Your workflow is deleted, and removed from your workflow list.