Create Pipeline
A pipeline defines a number of tasks that should be executed and how they interact with each other via their inputs and outputs.
In this tutorial, you will create a pipeline that takes the source code of the application from GitHub and then builds and deploys it on OpenShift.
Here is the YAML file that represents the above pipeline:
Once you deploy the pipelines, you should be able to visualize pipeline flow in the OpenShift Web Console by switching over to the Developer perspective of the OpenShift Web Console. select pipeline tab, select project as pipelines-tutorial
and click on pipeline build-and-deploy
This pipeline helps you to build and deploy backend/frontend, by configuring the right resources to pipeline.
Backend:
Clones the source code of the backend application from a git repository when (
git-repo
git resource) refered toapi-repo
Builds the container image of backend using the
buildah
clustertask that uses Buildah to build the imageThe application image is pushed to an image registry by referring (
image
image resource) toapi-image
The new backend application image is deployed on OpenShift using the
apply-manifests
andupdate-deployment
tasks.
Frontend:
Clones the source code of the backend application from a git repository when (
git-repo
git resource) referred toui-repo
Builds the container image of backend using the
buildah
clustertask that uses Buildah to build the imageThe application image is pushed to an image registry by referring (
image
image resource) toui-image
The new backend application image is deployed on OpenShift using the
apply-manifests
andupdate-deployment
tasks.
You might have noticed that there are no references to the git repository or the image registry it will be pushed to in pipeline. That's because pipeline in Tekton is designed to be generic and re-usable across environments and stages through the application's lifecycle. Pipelines abstract away the specifics of the git source repository and image to be produced as PipelineResources
. When triggering a pipeline, you can provide different git repositories and image registries to be used during pipeline execution. Be patient! You will do that in a little bit in the next section.
The execution order of task is determined by dependencies that are defined between the tasks via inputs and outputs as well as explicit orders that are defined via runAfter
.
Create the pipeline by running the following:
Alternatively, in the OpenShift Web Console, you can click on the + at the top right of the screen while you are in the pipelines-tutorial project:
Upon creating the pipeline via the web console, you will be taken to a Pipeline Details page that gives an overview of the pipeline you created.
Check the list of pipelines you have created using the CLI:
Last updated