Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions modules/op-assembling-a-pipeline.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@
[id="assembling-a-pipeline_{context}"]
= Assembling a Pipeline

A Pipeline represents a CI/CD flow and is defined by the Tasks to be executed. It is designed to be generic and reusable in multiple applications and environments.
A pipeline represents a CI/CD flow and is defined by the tasks to be executed. It is designed to be generic and reusable in multiple applications and environments.

A Pipeline specifies how the Tasks interact with each other and their order of execution using the `from` and `runAfter` parameters. It uses the `workspaces` field to specify one or more volumes that each Task in the Pipeline requires during execution.
A pipeline specifies how the tasks interact with each other and their order of execution, using the `from` and `runAfter` parameters. It uses the `workspaces` field to specify one or more volumes that each task in the pipeline requires during execution.

In this section, you will create a Pipeline that takes the source code of the application from GitHub and then builds and deploys it on {product-title}.
In this section, you will create a pipeline that takes the source code of the application from GitHub and then builds and deploys it on {product-title}.

//The image below displays the various components of `pipelines-tutorial` Pipeline, and how these components interact with each other.

//image::op-assemble-a-pipeline.png[]


The Pipeline performs the following tasks for the back-end application `vote-api` and front-end application `vote-ui`:
The pipeline performs the following tasks for the back-end application `vote-api` and front-end application `vote-ui`:

* Clones the source code of the application from the Git repository by referring to the `git-url` and `git-revision` parameters.
* Builds the container image using the `buildah` ClusterTask.
* Builds the container image using the `buildah` cluster task.
* Pushes the image to the internal image registry by referring to the `image` parameter.
* Deploys the new image on {product-title} by using the `apply-manifests` and `update-deployment` Tasks.
* Deploys the new image on {product-title} by using the `apply-manifests` and `update-deployment` tasks.

[discrete]
.Procedure

. Copy the contents of the following sample Pipeline YAML file and save it:
. Copy the contents of the following sample pipeline YAML file and save it:
+
[source,yaml,subs="attributes+"]
----
Expand Down Expand Up @@ -93,9 +93,6 @@ spec:
- name: update-deployment
taskRef:
name: update-deployment
workspaces:
- name: source
workspace: shared-workspace
params:
- name: deployment
value: $(params.deployment-name)
Expand All @@ -105,9 +102,9 @@ spec:
- apply-manifests
----
+
The Pipeline definition abstracts away the specifics of the Git source repository and image registries. These details are added as `params` when a Pipeline is triggered and executed.
The pipeline definition abstracts away the specifics of the Git source repository and image registries. These details are added as `params` when a pipeline is triggered and executed.

. Create the Pipeline:
. Create the pipeline:
+
----
$ oc create -f <pipeline-yaml-file-name.yaml>
Expand All @@ -120,13 +117,13 @@ Alternatively, you can also execute the YAML file directly from the Git reposito
$ oc create -f https://raw.githubusercontent.com/openshift/pipelines-tutorial/{pipelines-ver}/01_pipeline/04_pipeline.yaml
----

. Use the `tkn pipeline list` command to verify that the Pipeline is added to the application:
. Use the `tkn pipeline list` command to verify that the pipeline is added to the application:
+
----
$ tkn pipeline list
----
+
The output verifies that the `build-and-deploy` Pipeline was created:
The output verifies that the `build-and-deploy` pipeline was created:
+
----
NAME AGE LAST RUN STARTED DURATION STATUS
Expand Down