Skip to content

Latest commit

 

History

History
 
 

examples

Examples

This directory contains examples of the Pipeline CRDs in action.

To deploy them to your cluster (after installing the CRDs and running the controller):

kubectl apply -f examples/pipelines
kubectl apply -f examples/
kubectl apply -f examples/invocations

Example Pipelines

We have 2 example Pipelines in ./pipelines

  1. The Kritis Pipline: This example builds a Pipeline for the kritis project, and demonstrates how to configure a pipeline which:

    1. Runs unit tests
    2. Build an image
    3. Deploys it to a test environment
    4. Runs integration tests

    Pipeline Configuration

  2. Guestbook: This Pipeline is based on example application in the Kubernetes example Repo This pipeline demonstartes how to integrate frontend guestbook app code with backend redis-docker image provided by GCP.

    Pipeline Configuration

Example Tasks

Here are the Task Types that are defined.

  1. build-push: This task as the name suggests build an image via kaniko and pushes it to registry.
  2. make: Runs make target.
  3. integration-test-in-docker: This is a new task that is used in the sample pipelines to test an app in using docker build command to build an image with has the integration test code. This task then calls docker run which will run the test code. This follows the steps we have for kritis integration test
  4. deploy-with-helm: This task deploys a kubernetes app with helm.
  5. deploy-with-kubectl: This task deploys with kubectl apply -f

Example Runs

The runs dir contains an example TaskRun and an example PipelineRun.

run-kritis-test.yaml shows an example of how to manually run kritis unit test off your development branch.

kritis-pipeline-run.yaml shows an example of what it would look like to invoke the kritis example pipeline manually. In the conditions field for type Successful you can see that the status is False, which indicates that the Pipeline was not run successfully. The field message contains a human readable error indicating that one of the TaskRuns failed. This condition (and everything else in the status section) would be populated by the controller as it realized the PipelineRun (i.e. ran the Pipeline).