ceph-csi/deploy
Niels de Vos a02b38ac27 ci: use CentOS Stream 9 for Jenkins Jobs Builder image
CentOS Stream 8 does not provide a module named 'dataclasses'. It seems
current versions of Jenkins Jobs Builder require that. Python 3.7
offers the module by default, so using a new base distribution with
Python 3.9 has the module too.

See-also: #3909
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2023-06-21 08:11:51 +00:00
..
ceph-csi-buildconfig.yaml ci: migrate to new OpenShift cluster running on AWS 2023-03-20 09:21:41 +00:00
checkout-repo.sh ci: correct parameter passing in checkout-repo.sh 2023-03-20 09:21:41 +00:00
container-registry.yaml ci: migrate to new OpenShift cluster running on AWS 2023-03-20 09:21:41 +00:00
docker-gc.yaml ci: run registry garbage collection every week 2023-03-20 14:20:53 +00:00
Dockerfile ci: use CentOS Stream 9 for Jenkins Jobs Builder image 2023-06-21 08:11:51 +00:00
jjb-buildconfig.yaml ci: fix yamllint issues in jjb-buildconfig.yaml 2020-05-27 12:52:21 +02:00
jjb-config.yaml add scripts and configuration to deploy with Jenkins Job Builder 2020-04-01 14:15:04 +02:00
jjb-deploy.yaml ci: set ttlSecondsAfterFinished=10 to ensure job status can be checked 2021-08-09 14:47:18 +00:00
jjb-validate.yaml ci: set ttlSecondsAfterFinished=10 to ensure job status can be checked 2021-08-09 14:47:18 +00:00
jjb.sh ci: deploy/jjb.sh should fail on wrong arguments 2020-11-04 10:09:57 +00:00
Makefile ci: remove old jobs when deploying 2020-09-25 08:03:00 +00:00
README.md add scripts and configuration to deploy with Jenkins Job Builder 2020-04-01 14:15:04 +02:00

Deploying Jenkins Jobs through OpenShift

This deploy/ directory contains the configuration to prepare running Jenkins Job Builder on OpenShift and update/add Jenkins Jobs in an environment hosted in the same OpenShift project.

The used Jenkins environment is expected to be deployed already. This is done by the CentOS CI team when a request for CI resources is handled. The deploying and configuration of Jenkins is therefor not part of this document.

Building the Jenkins Job Builder container image

OpenShift has a feature called ImageStreams. This can be used to build the container image that contains the jenkins-jobs executable to test and update/add jobs in a Jenkins environment.

All .yaml files in this directory need to be pushed into OpenShift, use oc create -f <file> for that.

  • the Dockerfile uses pip to install jenkins-jobs, the BuildConfig object in OpenShift can then be used to build the image
  • checkout-repo.sh will be included in the container image, and checks out the ci/centos branch of the repository
  • together with the Makefile (checked out with checkout-repo.sh), the Jenkins Jobs can be validated or deployed
  • jjb-buildconfig.yaml creates the ImageStream and the BuildConfig objects. Once created with oc create, the OpenShift Console shows a Build button for the jjb image under the Builds/Builds menu
  • jjb-config.yaml is the /etc/jenkins_jobs/jenkins_jobs.ini configuration files that contains username, password/token and URL to the Jenkins instance (edit this file before pushing to OpenShift)
  • jjb-validate.yaml is the OpenShift Job that creates a Pod, runs the validation test and exits. The job needs to be deleted from OpenShift before it can be run again.
  • jjb-deploy.yaml is the OpenShift Job that creates a Pod, runs jenkins-jobs to push the new jobs to the Jenkins environment. This pod uses the jjb-config ConfigMap to connect and login to the Jenkins instance. The job needs to be deleted from OpenShift before it can be run again.
  • jjb.sh is a helper script that can be used to validate/deploy the Jenkins Jobs in the parent directory. It creates the validate or deploy job, waits until the job finishes, shows the log and exits with 0 on success. This script can be used in Jenkins Jobs to automate the validation and deployment of jobs.