This service is designed to use Jenkins for executing various continuous delivery tasks. Thus, this service can make use of Jenkins jobs to:
To trigger these jobs, the service has subscriptions to event channels. In more details, the current implementation of the service listens to CloudEvents from type:
sh.keptn.events.configuration-changed
: When receiving this event, the service deploys an application based on the new configuration.sh.keptn.events.deployment-finished
: When receiving this event, the service executes a test for a deployed application.sh.keptn.events.evaluation-done
: When receiving this event, the service verifies the evaluation to decide whether the deployment can be promoted to the next stage.During the setup of the Jenkins, a secret is created that contains key-value pairs for the Jenkins URL, Jenkins user, and password:
The docker-jenkins
folder contains a Dockerfile
and all artifacts for building the Jenkins container image. Characteristics of this Jenkins image are:
To install the service, specify values for the following parameters:
Run the deploy.sh
script as shown below:
$ ./deploy.sh $REGISTRY_URL $JENKINS_USER $JENKINS_PASSWORD $GITHUB_USER_NAME $GITHUB_USER_EMAIL $GITHUB_ORGANIZATION $GITHUB_PERSONAL_ACCESS_TOKEN
To verify the installation, execute the following kubectl
commands:
$ kubectl get ksvc -n keptn
NAME AGE
...
jenkins-service 1m
...
$ kubectl get pods -n keptn
NAME READY STATUS RESTARTS AGE
...
jenkins-service-cjtgp-deployment-78c8588b6f-q4hzd 3/3 Running 0 1m
...
To uninstall Jenkins, execute the following commands:
$ kubectl delete -f ./config/jenkins/gen/k8s-jenkins-deployment.yaml
$ kubectl delete -f ./config/jenkins/k8s-jenkins-pvcs.yaml
$ kubectl delete -f ./config/jenkins/k8s-jenkins-rbac.yaml
To uninstall the service, execute the following command:
$ kubectl delete -f ./config/gen/service.yml