CSI driver for Ceph
Go to file
Niels de Vos 1cb2eef010 ci: address ShellCheck issues in deploy/jjb.sh
In ./deploy/jjb.sh line 11:
	oc get pod/${1} --no-headers -o=jsonpath='{.status.phase}'
                   ^--^ SC2086: Double quote to prevent globbing and word splitting.

In ./deploy/jjb.sh line 29:
cd $(dirname ${0})
^----------------^ SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
   ^-------------^ SC2046: Quote this to prevent word splitting.
             ^--^ SC2086: Double quote to prevent globbing and word splitting.

In ./deploy/jjb.sh line 31:
oc create -f jjb-${CMD}.yaml
                 ^----^ SC2086: Double quote to prevent globbing and word splitting.

In ./deploy/jjb.sh line 36:
	jjb_pod=$(oc get pods --no-headers -l job-name=jjb-${CMD} -o=jsonpath='{.items[0].metadata.name}')
                                                           ^----^ SC2086: Double quote to prevent globbing and word splitting.

In ./deploy/jjb.sh line 37:
	[ ${?} = 0 ] && [ -n "${jjb_pod}" ] && break
          ^--^ SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.

In ./deploy/jjb.sh line 46:
	[ ${?} = 0 ] && ( [ "${status}" = "Succeeded" ] || [ "${status}" = "Failed" ] ) && break
          ^--^ SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
                        ^-- SC2235: Use { ..; } instead of (..) to avoid subshell overhead.

In ./deploy/jjb.sh line 54:
oc delete --wait -f jjb-${CMD}.yaml
                        ^----^ SC2086: Double quote to prevent globbing and word splitting.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
2020-05-27 12:52:21 +02:00
deploy ci: address ShellCheck issues in deploy/jjb.sh 2020-05-27 12:52:21 +02:00
containerized-tests.groovy ci: use parameters set by github-pull-request-builder 2020-05-25 17:10:06 +02:00
containerized-tests.yaml ci: use parameters set by github-pull-request-builder 2020-05-25 17:10:06 +02:00
jjb-deploy.yaml add jjb-<cmd> jobs for validating/deploying Jenkins jobs 2020-04-01 14:15:04 +02:00
jjb-validate.yaml add jjb-<cmd> jobs for validating/deploying Jenkins jobs 2020-04-01 14:15:04 +02:00
prepare.sh ci: address ShellCheck issues in prepare.sh 2020-05-27 12:52:21 +02:00
README.md doc: update README.md for the containerized-tests job 2020-05-25 17:22:11 +02:00

Continuous Integration Jobs for the CentOS CI

  • dedicated Jenkins instance for Ceph-CSI
  • Jenkins is hosted on OpenShift in the CentOS CI
  • scripts and Jenkins jobs are hosted in the Ceph-CSI repository (ci/centos branch)
  • a Jenkins Pipeline is used to reserve bare metal system(s), and run jobs on those systems

Repository/Branch Structure

This is the ci/centos branch, where all the scripts for the Jenkins jobs are maintained. The tests that are executed by the jobs are part of the normal projects branches.

As an example, the containerized-tests Jenkins job consists out of the following files:

  • containerized-tests.yaml is a Jenkins Job Builder configuration that describes the events when the job should get run and fetches the .groovy file from the git repository/branch

  • containerized-tests.groovy is the Jenkins Pipeline that contains the stages for the Jenkins Job itself. In order to work with the bare-metal machines from the CentOS CI, it executes the following stages:

    1. dynamically allocate a Jenkins Slave (node('cico-workspace')) with tools and configuration to request a bare-metal machine
    2. checkout the centos/ci branch of the repository, which contains scripts for provisioning and preparing the environment for running tests
    3. reserve a bare-metal machine with cico (configured on the Jenkins Slave)
    4. provision the reserved bare-metal machine with additional tools and dependencies to run the test (see prepare.sh below)
    5. run make containerized-tests and make containerized-build in parallel
    6. as final step, return the bare-metal machine to the CentOS CI for other users (it will be re-installed with a minimal CentOS environment again)
  • prepare.sh installs dependencies for the test, and checks out the git repository and branch (or Pull Request) that contains the commits to be tested (and the test itself)

Deploying the Jenkins Jobs

The Jenkins Jobs are described in Jenkins Job Builder configuration files and Jenkins Pipelines. These need to be imported in the Jenkins instance before they can be run. Importing is done with the jenkins-jobs command, which runs in a jjb container. To build the container, and provide the configuration for Jenkins Job Builder, see the documentation in the deploy/ directory.