keptn-contrib / jenkins-service

ARCHIVED. This service has been deprecated and is no longer actively maintained.
Apache License 2.0
2 stars 5 forks source link

Build Status

Keptn Jenkins Service

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:

Secret for credentials

During the setup of the Jenkins, a secret is created that contains key-value pairs for the Jenkins URL, Jenkins user, and password:

Docker Jenkins

The docker-jenkins folder contains a Dockerfile and all artifacts for building the Jenkins container image. Characteristics of this Jenkins image are:

Install service

  1. To install the service, specify values for the following parameters:

    • REGISTRY_URL - URL of the container registry
    • JENKINS_USER - Jenkins user
    • JENKINS_PASSWORD - Password of Jenkins user
    • GITHUB_USER_EMAIL - Email of GitHub user
    • GITHUB_ORGANIZATION - GitHub organization used by keptn
    • GITHUB_PERSONAL_ACCESS_TOKEN - Personal access token from GitHub user
  2. 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 
  3. 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
    ...

Uninstall service

  1. 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
  2. To uninstall the service, execute the following command:

    $ kubectl delete -f ./config/gen/service.yml