Skip to content

Commit

Permalink
fix(build/scripts): check git ref is master correctly
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
  • Loading branch information
leodido authored and dalehamel committed Oct 28, 2020
1 parent 7c9ef9d commit aeebd8a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions build/scripts/ci-release-image.sh
Expand Up @@ -11,21 +11,21 @@ QUAY_BOT_USER=${QUAY_BOT_USER:-kubectltrace_buildbot}
git_ref=$1 # github.ref format: refs/REMOTE/REF
# eg, refs/heads/BRANCH
# refs/tags/v0.9.6-pre
git_base_ref=$(basename ${git_ref})
git_base_ref=$(basename "${git_ref}")

make=$(command -v make)
docker=$(command -v docker)

makeopts=""
if [[ ! -z "${git_base_ref}" ]]; then
if [[ -n "${git_base_ref}" ]]; then
makeopts="-e GIT_BRANCH=${git_base_ref} ${makeopts}"
fi

if [[ ! -z "$QUAY_TOKEN" ]]; then
if [[ -n "$QUAY_TOKEN" ]]; then
$docker login -u="${GIT_ORG}+${QUAY_BOT_USER}" -p="$QUAY_TOKEN" quay.io
$make $makeopts image/push
$make "$makeopts" image/push

if [[ "${git_ref_id}" = "master" ]] && [[ "${git_base_ref}" = "" ]]; then
$make $makeopts image/latest
if [[ "${git_base_ref}" = "master" ]]; then
$make "$makeopts" image/latest
fi
fi

0 comments on commit aeebd8a

Please sign in to comment.