add default tag (#1)
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
9
check.sh
9
check.sh
@@ -28,18 +28,23 @@ fi
|
|||||||
echo "${BASE}" | grep -q "/" || BASE="library/${BASE}"
|
echo "${BASE}" | grep -q "/" || BASE="library/${BASE}"
|
||||||
echo "${TARGET}" | grep -q "/" || TARGET="library/${TARGET}"
|
echo "${TARGET}" | grep -q "/" || TARGET="library/${TARGET}"
|
||||||
|
|
||||||
|
# if no tag is give default to latest
|
||||||
|
echo "${BASE}" | grep -q ":" || BASE="${BASE}:latest"
|
||||||
|
echo "${TARGET}" | grep -q ":" || TARGET="${TARGET}:latest"
|
||||||
|
|
||||||
# move tha tag to its own var and remove it from the repo name
|
|
||||||
|
# move the tag to its own var and remove it from the repo name
|
||||||
BASE_TAG=$(echo "${BASE}" | sed 's/[^:]*://')
|
BASE_TAG=$(echo "${BASE}" | sed 's/[^:]*://')
|
||||||
TARGET_TAG=$(echo "${TARGET}" | sed 's/[^:]*://')
|
TARGET_TAG=$(echo "${TARGET}" | sed 's/[^:]*://')
|
||||||
|
|
||||||
BASE_REPO=$(echo "${BASE}" | sed 's/:.*//')
|
BASE_REPO=$(echo "${BASE}" | sed 's/:.*//')
|
||||||
TARGET_REPO=$(echo "${TARGET}" | sed 's/:.*//')
|
TARGET_REPO=$(echo "${TARGET}" | sed 's/:.*//')
|
||||||
|
|
||||||
|
|
||||||
|
# build the url to the repo
|
||||||
BASE_URL="https://hub.docker.com/v2/repositories/${BASE_REPO}/tags/${BASE_TAG}"
|
BASE_URL="https://hub.docker.com/v2/repositories/${BASE_REPO}/tags/${BASE_TAG}"
|
||||||
TARGET_URL="https://hub.docker.com/v2/repositories/${TARGET_REPO}/tags/${TARGET_TAG}"
|
TARGET_URL="https://hub.docker.com/v2/repositories/${TARGET_REPO}/tags/${TARGET_TAG}"
|
||||||
|
|
||||||
|
|
||||||
# login if credentias are passed
|
# login if credentias are passed
|
||||||
HEADER=""
|
HEADER=""
|
||||||
if [ -n "${DOCKER_USERNAME}" ] && [ -n "${DOCKER_PASSWORD}" ]; then
|
if [ -n "${DOCKER_USERNAME}" ] && [ -n "${DOCKER_PASSWORD}" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user