ceph-csi/deploy/checkout-repo.sh
Niels de Vos 6d906b415f add scripts and configuration to deploy with Jenkins Job Builder
These files make it possible to
- build a container image that includes Jenkins Job Builder
- store the container image in the OpenShift ImageStream
- use the container to validate or deploy the Jenkins Jobs

More details about the files are included in the README.md.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
2020-04-01 14:15:04 +02:00

18 lines
337 B
Bash
Executable File

#!/bin/sh
fail() {
echo "${@}" > /dev/stderr
exit 1
}
[ -n "${GIT_REPO}" ] || fail 'GIT_REPO environment variable not set'
[ -n "${GIT_REF}" ] || fail 'GIT_REF environment variable not set'
# exit in case a command fails
set -e
git init .
git remote add origin "${GIT_REPO}"
git fetch origin "${GIT_REF}"
git checkout "${GIT_REF}"