ceph-csi/deploy/jjb-deploy.yaml
Niels de Vos 5f9222d7ee ci: run jjb-validate batch job against a PR
The batch job templates for OpenShift use a GIT_REF variable that is
used by the jobs to checkout the repository. This defaults to
"ci/centos", but it never is adjusted when jjb-validate runs against a
PR.

With the new GIT_REF environment variable in the jjb.sh script, the
variable can now be used to checkout a PR from gitHub and run the
validation against that.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
2020-09-22 11:59:31 +02:00

50 lines
1.3 KiB
YAML

---
kind: Template
apiVersion: v1
metadata:
name: my-template
objects:
- apiVersion: batch/v1
kind: Job
metadata:
labels:
app: jjb
jjb/session: "${SESSION}"
name: jjb-deploy
spec:
ttlSecondsAfterFinished: 0
backoffLimit: 1
template:
metadata:
labels:
app: jjb-deploy
jjb/session: "${SESSION}"
spec:
containers:
- name: jjb
image: image-registry.openshift-image-registry.svc:5000/ceph-csi/jjb:latest
env:
- name: GIT_REPO
value: https://github.com/ceph/ceph-csi
- name: GIT_REF
value: "${GIT_REF}"
- name: MAKE_TARGET
value: deploy
volumeMounts:
- name: etc-jj
mountPath: /etc/jenkins_jobs
readOnly: true
volumes:
- name: etc-jj
configMap:
name: jenkins-jobs
restartPolicy: Never
parameters:
- name: SESSION
description: unique ID for the session to track the pod for the job
required: true
- name: GIT_REF
description: the git branch or other ref to checkout and deploy
value: ci/centos
required: false