mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-26 16:20:28 +00:00
6e38694a11
Jenkins Jobs Builder fails like this, indicating the order of the parameters is important: ``` $ jenkins-jobs update --allow-empty-variables --delete-old jobs usage: jenkins-jobs [-h] [--conf CONF] [-l LOG_LEVEL] [--ignore-cache] [--flush-cache] [--version] [--allow-empty-variables] [--server SECTION] [--user USER] [--password PASSWORD] {delete,delete-all,get-plugins-info,list,test,update} ... jenkins-jobs: error: unrecognized arguments: --allow-empty-variables ``` Signed-off-by: Niels de Vos <ndevos@ibm.com> |
||
---|---|---|
.. | ||
ceph-csi-buildconfig.yaml | ||
checkout-repo.sh | ||
container-registry.yaml | ||
docker-gc.yaml | ||
Dockerfile | ||
jjb-buildconfig.yaml | ||
jjb-config.yaml | ||
jjb-deploy.yaml | ||
jjb-validate.yaml | ||
jjb.sh | ||
Makefile | ||
README.md |
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
usespip
to installjenkins-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 theci/centos
branch of the repository- Together with the
Makefile
(checked out withcheckout-repo.sh
), the Jenkins Jobs can be validated or deployed jjb-buildconfig.yaml
creates the ImageStream and the BuildConfig objects. Once created withoc create
, the OpenShift Console shows aBuild
button for thejjb
image under the Builds/Builds menujjb-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, runsjenkins-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.