Pipeline Configuration
Solution Designer provides a UI to configure the pipelines used to deploy the built projects to the desired target project. This configuration can be accessed from the CI/CD capability which is located on the navigation bar on the left. On this page it is possible to create, edit and delete the pipeline configurations.
Create Pipeline Configurations
To create a new pipeline configuration for a project to deploy it to a particular namespace (k5-project) use the Create capability on the project's Pipeline Configuration tab. The master data you need to provide is the following:
Property | Description |
---|---|
Type | There are 2 types of pipelines: Build & Deploy and Deploy. A Build & Deploy pipeline creates your project from source and also deploys it, while a Deploy pipeline uses an existing image created in an earlier stage and deploys that project into the selected project. |
Name | A unique name for your pipeline configuration |
Skip Testing | This can be used to skip the implemented tests during the pipeline run (optional) |
Target Project | The OpenShift target project to which the project will be deployed |
Image Tag | With every pipeline run an image will be generated. On successful pipeline execution, the image will be tagged with the value provided in this field. |
Application | The application tag can be used to group multiple deployments in applications (optional) |
Git Credentials | This is only for the Build & Deploy pipeline. You can either use personal Git credentials or dedicated Git credentials. Choosing the latter, you will be asked to fill in the Git Username and Git Access Token. The Git Username is the name of a Git user with access to the Git repository of the project. This user will be used to access the Git repository when running the pipeline. The Git Access Token is the token of a Git user with access to the Git repository of the project. This token will be used to access to the Git repository when running the pipeline. |
Source Project | This is only for the Deploy pipeline. This is the OpenShift project, where the pipeline will listen for new images. |
Pipeline Source Image Tag | This is only for the Deploy pipeline. A pipeline run will be triggered whenever a new image with the given tag is registered in the source project. |
Auto Deploy | This can be configured for both types of pipeline configurations. For Build & Deploy the pipeline can be automatically triggered after a change in the Git repository. For Deploy it will be triggered after a new image is registered in the source project with the given tag (optional) |
Prerequisites for the Auto-Deploy feature
For Build & Deploy pipelines:
It is mandatory that a webhook (for push events) is activated in the regarding Git repository. This has to be done manually. For creating a webhook (trigger), a webhook URL and secret token is needed.
The webhook URL can be configured/found in the k5-project CRD, please see Create and Configure OpenShift Projects as Deployment Targets (the required parameter is spec.configuration.pipelineManager.webhookUrl)
The token secret can be found in the OpenShift secret k5-git-webhook-secret in the regarding k5-project. The following command can be used to get the token:
oc -n k5project-namespace get secret k5-git-webhook-secret -o jsonpath='{.data.token}' | base64 -d; echo
For Deploy pipelines:
It is required that the pipeline manager component is able to watch for image stream changes in an upstream k5-project. This can be done manually or by setting spec.previousStages in the k5-project CRD instance, please see Create and Configure OpenShift Projects as Deployment Targets.
For manually enabling the pipeline manager (e.g. of test-stage) to watch for changes of the solution images in another k5-project (e.g. dev-stage) the pipeline manager service account (k5-admin-sa) needs the following permission (role-binding):
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: k5-imagestreams-pipeline-manager-rb
namespace: dev-stage
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: k5-imagestreams-pipeline-manager-role
subjects:
- kind: ServiceAccount
name: k5-admin-sa
namespace: test-stage
Manage Pipeline Configurations
Solution Designer offers several tools to manage all your pipeline configurations from within the CI/CD capability that can be found on the navigation bar on the left. The CI/CD page is separated in the following tabs:
Pipeline Configurations
Pipeline Runs
Pipeline Configurations Tab
The Pipeline Configurations tab shows a list of all pipelines configured for this solution. The table also provides information on the pipeline (incl. a link to the OpenShift Web Console), the linked name of the project, the linked name of the last pipeline run, as well as the last run status and the last run time.
Each row consists of one Pipeline Configuration and provides the following inline capabilities:
Info button that opens the Details View of that configuration
Run button that triggers the pipeline
Delete button that deletes the pipeline configuration
Pipeline Runs Tab
The Pipeline Runs tab shows a list of all pipeline runs related with this solution. It provides the following information:
Name of the pipeline run (with link to OpenShift Web Console)
Name of the project (with link to OpenShift Web Console)
Time started
Run status
Task status
Duration
Name of the pipeline (with link to OpenShift Web Console) - this column is not visible by default