Build and Deploy

Get a insight how the solution gets tested, built and deployed and the configuration option of the pipeline.

OpenShift Pipelines (based on tekton) is used as technology for Solution Pipelines. The k5-project-operator will deploy the Pipeline Manager and create the needed Pipeline definitions in a new envoy during creating or updating the envoy. The Pipeline Manager running in the envoy is used by the Solution Designer for creating new Solution Pipelines and trigger them. If a new Solution Pipeline is created the Pipeline Manager creates a new Pipeline and additional needed Pipeline Resources to run the Pipeline for a specific solution. The Solution Pipeline will create all needed files, docker images, helm charts to deploy, test and run a solution into the Envoy. Every Solution Pipeline is responsible for deploying one solution into its Envoy.

Types of Pipelines

There are two types of Pipelines:

Build and Deploy Pipeline

The Build and Deploy Pipeline will first compile and build the solution (docker images and helm chart) from the configured git source and then deploy the solution into the defined target project.

Deploy Pipeline

The Deploy Pipeline uses an already existing image created in an earlier stage and deploys it to its defined target project. That means that one or more Deploy Pipelines can use the result of a Build and Deploy Pipeline or an another upstream Deploy Pipeline. The Deploy Pipeline starts automatically whenever the related image in the source project has changed.

Manually enable Deploy Pipeline to get images from an source project

This step is not needed if this setting is configured and done by the k5 project operator, please see Create a k5project (spec.previousStages). For manually enabling a Deploy Pipeline (e.g. test-stage) to get and use the created solution images from a specific source project (e.g. dev-stage) the used service account (pipline) for running the pipelines needs permissions for pulling imagestreams from the source project (e.g. where the Build and Deploy Pipeline is configured). The following templates can be used for that:

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata: 
  name: k5-imagestreams-pipeline-rb
  namespace: dev-stage
roleRef: 
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: k5-imagestreams-pipeline-role
subjects: 
- kind: ServiceAccount
  name: pipeline
  namespace: test-stage
        

General information

The creation, triggering and deletion of a new Pipeline can be done in the Solution Desinger. The creation of a new Pipeline will also trigger the first execution/run of the Pipeline. All created Pipelines can then be retriggered in the Solution Desinger manually. Use the 'Run' button in the Overview CI/CD page in the Solution Designer to start a (build and) deployment of your solution.

Important:

Attention: Please do not create, run or retrigger a Solution Pipeline using the OpenShift Console (Developer view -> Pipelines). Only the Solution Designer should be used for that.