Solution Pipeline Configuration

Solution Designer provides a UI to configure the pipelines used to deploy the built solutions 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 solution to deploy it to a particular namespace (k5-project) use the Create capability on the solution's Pipeline Configuration tab. The master data you need to provide is the following:

Table 1. Pipeline Configuration Parameters
Property Description
Type There are 2 types of pipelines: Build & Deploy and Deploy. A Build & Deploy pipeline creates your solution from source and also deploys it, while a Deploy pipeline uses an existing image created in an earlier stage and deploys that solution into the selected project.

This field is mandatory
Name A unique name for your pipeline configuration.

This field is mandatory
Skip Testing This can be used to skip the implemented tests during the pipeline run.

This field is optional

Target Project The OpenShift target project into which the solution will be deployed.

This field is mandatory
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.

This field is mandatory

Application The application tag can be used to group multiple deployments in applications.

This field is optional

Git Credentials This is only for the Build & Deploy pipeline. There are two possible options:
  • Use personal Git credentials that were already defined in the Solution Designer
  • Use 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 solution. 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 solution. This token will be used to access to the Git repository when running the pipeline.

This field is mandatory

Source Project This is only for the Deploy pipeline. This is the OpenShift project, where the pipeline will listen for new images.

This field is mandatory

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.

This field is mandatory

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.

This field is optional

Attention: The Auto-Deploy flag for Build & Deploy pipelines is only available for solutions stored in GitLab or GitHub. In case of using Bitbucket as a Git provider for the solution, the pipeline run must be triggered manually.

Prerequisites to use 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

Prerequisites to use the Auto-Deploy feature for Deploy pipelines

It is required that the pipeline manager component is able to watch for imagestream 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

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
  • Deletebutton that deletes the pipeline configuration

Pipeline Runs

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

The links to the OpenShift Web Console direct to the respective sub-page and require authentication.