The installation procedure for adding a Canary Deployment Jenkins job includes the following steps:
- Add a new Item as a copy from the CD Jenkins job.
- Rename the parameter
Build selector for Copy Artifact
toBuildFromCDPipeline
. - Add these parameters:
- A String Parameter named
ProductionWeight
. - A
Build selector for Copy Artifact
namedBuildFromCIPipeline
. - A Boolean named
FINALIZE
.
- A String Parameter named
- In the build section:
- Change the Project name under the
Copy artifacts from another project
build step to point to CD. Change the command under the build step
Execute shell
to this:#!/bin/bash echo Switch context to $ClusterContext kubectl config use-context $ClusterContext set -x rm -rf Helm tar -xvf Helm.tar if [[ $FINALIZE == "true" ]]; then #Usage ./canaryDeploy.sh -p <Prod Weight> -f -h <Helm chart dir> -g <Git Helmchart dir> -m <commit message> -n <namespace> Scripts/canaryDeploy.sh -f -h Helm -g <Change to your Git Helmchart dir> -m <Change to your commit message> -n $Namespace else Scripts/canaryDeploy.sh -p $ProductionWeight -h Helm -n $Namespace fi
- Change the Project name under the
- Apply your changes.
- When selecting
Build with Parameters
it should now look like this (the picture contains example field values):
Add Comment