After logging in to Wercker, select the application ‘simple-workflow-example’ to create a
workflow for, and click the Workflows tab.
In the Editor section, you can create and edit workflows.
A workflow is a sequence of pipelines that run in a defined order.
There’s always a single first pipeline – the build pipeline, which can be followed by other
pipelines running in series or in parallel.
The Pipelines section allows you to define and edit workflow pipelines.
When you define a pipeline, you specify the hook type, the actual pipeline definition
per your application’s wercker.yml, and any environment variables.
Let’s now look at the pipelines that are defined in our application’s wercker.yml file.
There are five pipelines, in addition to the build pipeline:
1. unit test
2.build image hyphen test
3.deploy hyphen image
4. verify deployment
5. report success
The deploy-image pipeline uses two environment variables that must be defined.
These are: • USERNAME – which is your Docker Hub
username, and • PASSWORD – which is your Docker Hub
password
The verify-deployment pipeline also uses the ‘PASSWORD’ environment variable.
You can associate environment variables with pipelines when you create pipelines.
We’ll now create the ‘unit test’ pipeline.
Click ‘Add new pipeline’.
Enter a name for the pipeline.
This will appear in the Pipelines list, and is used to represent this pipeline in the
workflow diagram.
This name doesn’t need to match the name
of the corresponding pipeline that’s defined in your wercker.yml file.
Next, enter the name of the pipeline as defined in your wercker.yml file.
Select ‘Default’ as the hook type, which configures this pipeline to be triggered by
another pipeline in the workflow.
Click ‘Create’.
The Workflows tab now includes the unit test 1 pipeline.
Repeat this process to create the remaining pipelines.
The Pipelines section now lists all the pipelines.
Let’s create the environment variables required by the deploy-image pipeline.
Select ‘deploy image’ from the list of pipelines.
Enter the name of the variable, and its value.
We recommend protecting this variable, which hides its value.
To do this, select Protected.
Click ‘Add’ to complete creating the variable.
We’ll follow the same steps to create the ‘PASSWORD’ environment variable, by entering
the variable name, value, selecting Protected, and clicking add.
The environment variables have now been created.
Now, we’ll create the workflow.
Click the Workflows tab.
The plus sign indicates the nodes in a workflow.
Each pipeline is triggered at the node you select.
The node also marks the end of the previous pipeline.
Click the plus sign to add a pipeline.
We can skip the branch details, and select the pipeline to execute after the current
pipeline.
The ‘Execute pipeline’ dropdown lists all the pipelines we’ve created.
Let’s select unit-test-1 from the dropdown to execute after the build pipeline is complete.
Click Add.
The workflow now includes the unit-test-1 pipeline.
You can design your workflow to execute the pipelines in a sequence, with each pipeline
triggering the next, or fork them to execute them in parallel.
For this example, we repeated the steps to
add the other pipelines we created, to our workflow.
Here’s the complete workflow, with pipelines set to trigger both in sequence and in parallel.
We can now test the pipelines.
Click the Runs tab, and then click the build pipeline.
Click ‘Execute this pipeline again’ from the Actions menu.
Click Execute pipeline.
We can view the progress of the pipelines being executed.
The clock icon indicates that the pipeline is scheduled and waiting for the previous
pipeline to complete.
And after a short wait, we see that all the pipelines have run successfully!
You can take a closer look at the steps performed by a pipeline by selecting the pipeline from
the workflow, and clicking a step within the pipeline to view its output.
Learn more at cloud.oracle.com/containers/pipelines.
Thanks for watching.