File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,9 +13,10 @@ set -xeuo pipefail
1313# DRY_RUN - when set, skip all push operations (e.g. set for PR builds)
1414
1515IMAGE=" ${TO_IMAGE} :${TO_TAG} -${ARCH} "
16- export TO_REGISTRY=${TO_IMAGE%%/* }
16+ TO_REGISTRY=$( echo " $TO_IMAGE " | cut -d/ -f1)
17+ export TO_REGISTRY
1718
18- ./login.sh
19+ . . /login.sh
1920
2021if [ -n " ${USE_CACHE:- } " ]; then
2122 CACHE_IMAGE_FULL=" ${CACHE_IMAGE} :${TO_TAG} -${ARCH} "
4647if [ -z " ${DRY_RUN:- } " ] && [ -n " ${USE_CACHE:- } " ]; then
4748 buildah push " $IMAGE " " $CACHE_IMAGE_FULL "
4849elif [ -n " ${DRY_RUN:- } " ] && [ -n " ${USE_CACHE:- } " ]; then
49- echo " Push skipped: DRY_RUN is set or REPO_USERNAME or REPO_PASSWORD missing"
50+ echo " Push to cache skipped: DRY_RUN is set or REPO_USERNAME or REPO_PASSWORD missing"
5051fi
Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ set -xeuo pipefail
1111# CACHE_IMAGE, CACHE_USERNAME, CACHE_PASSWORD - sidecar cache registry (optional)
1212# DRY_RUN - when set, skip all push operations (e.g. set for PR builds)
1313
14- export TO_REGISTRY=${IMAGE%%/* }
14+ TO_REGISTRY=$( echo " $IMAGE " | cut -d/ -f1)
15+ export TO_REGISTRY
1516
16- ./login.sh
17+ . . /login.sh
1718
1819echo " Creating manifest for $IMAGE :$TAG "
1920buildah manifest rm " $IMAGE :$TAG " 2> /dev/null || true
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -xeuo pipefail
33
4- if [ -n " ${REPO_USERNAME:- } " ] && [ -n " ${REPO_PASSWORD:- } " ]; the
4+ if [ -n " ${REPO_USERNAME:- } " ] && [ -n " ${REPO_PASSWORD:- } " ]; then
55 echo " Logging in to $TO_REGISTRY "
66 echo " $REPO_PASSWORD " | buildah login -u " $REPO_USERNAME " --password-stdin " $TO_REGISTRY "
77elif [ -n " ${AWS_REGION:- } " ] && [ -n " ${AWS_ACCESS_KEY_ID:- } " ] && [ -n " ${AWS_SECRET_ACCESS_KEY:- } " ]; then
1313USE_CACHE=
1414if [ -n " ${CACHE_IMAGE:- } " ] && [ -n " ${CACHE_USERNAME:- } " ] && [ -n " ${CACHE_PASSWORD:- } " ]; then
1515 USE_CACHE=1
16- CACHE_REGISTRY=${ CACHE_IMAGE%%/* }
16+ CACHE_REGISTRY=$( echo " $ CACHE_IMAGE" | cut -d/ -f1 )
1717 echo " Logging in to $CACHE_REGISTRY (cache will be used)"
1818 echo " $CACHE_PASSWORD " | buildah login -u " $CACHE_USERNAME " --password-stdin " $CACHE_REGISTRY "
1919fi
You can’t perform that action at this time.
0 commit comments