mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-23 06:40:23 +00:00
18 lines
337 B
Bash
18 lines
337 B
Bash
|
#!/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}"
|