From 74800fee55b9fbab9b7201d86f7b7d0d61b97606 Mon Sep 17 00:00:00 2001 From: vista Date: Sun, 12 Mar 2023 11:11:48 +0100 Subject: [PATCH 1/5] add default tag --- check.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/check.sh b/check.sh index 363d0a5..2643ba7 100644 --- a/check.sh +++ b/check.sh @@ -36,10 +36,20 @@ TARGET_TAG=$(echo "${TARGET}" | sed 's/[^:]*://') BASE_REPO=$(echo "${BASE}" | sed 's/:.*//') TARGET_REPO=$(echo "${TARGET}" | sed 's/:.*//') +# if no tag is give default to latest +if [ -z "${BASE_TAG}" ]; then + BASE_TAG="latest" +fi + +if [ -z "${TARGET_TAG}" ]; then + TARGET_TAG="latest" +fi + + +# build the url to the repo 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}" - # login if credentias are passed HEADER="" if [ -n "${DOCKER_USERNAME}" ] && [ -n "${DOCKER_PASSWORD}" ]; then -- 2.49.1 From 9dde049945871fc2266a5b034415af222428ead5 Mon Sep 17 00:00:00 2001 From: vista Date: Sun, 12 Mar 2023 11:16:15 +0100 Subject: [PATCH 2/5] Update '.woodpecker/build.yml' --- .woodpecker/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml index 12bfb61..da82400 100644 --- a/.woodpecker/build.yml +++ b/.woodpecker/build.yml @@ -19,6 +19,7 @@ pipeline: password: from_secret: DOCKERHUB_TOKEN repo: vistanarvas/${CI_REPO_NAME} + tag: ${CI_COMMIT_BRANCH} auto_tag: true when: cron: nightly -- 2.49.1 From 07925fd8959d8571796bd70706f23e5d0e8b5703 Mon Sep 17 00:00:00 2001 From: vista Date: Sun, 12 Mar 2023 11:28:49 +0100 Subject: [PATCH 3/5] Update 'check.sh' --- check.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/check.sh b/check.sh index 2643ba7..e47fbad 100644 --- a/check.sh +++ b/check.sh @@ -28,6 +28,10 @@ fi echo "${BASE}" | grep -q "/" || BASE="library/${BASE}" 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 BASE_TAG=$(echo "${BASE}" | sed 's/[^:]*://') @@ -36,15 +40,6 @@ TARGET_TAG=$(echo "${TARGET}" | sed 's/[^:]*://') BASE_REPO=$(echo "${BASE}" | sed 's/:.*//') TARGET_REPO=$(echo "${TARGET}" | sed 's/:.*//') -# if no tag is give default to latest -if [ -z "${BASE_TAG}" ]; then - BASE_TAG="latest" -fi - -if [ -z "${TARGET_TAG}" ]; then - TARGET_TAG="latest" -fi - # build the url to the repo BASE_URL="https://hub.docker.com/v2/repositories/${BASE_REPO}/tags/${BASE_TAG}" -- 2.49.1 From 7c01b16e88ce1850f3bf67aa8fad77de56ade18b Mon Sep 17 00:00:00 2001 From: vista Date: Sun, 12 Mar 2023 11:32:18 +0100 Subject: [PATCH 4/5] Update 'check.sh' [CI SKIP] --- check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check.sh b/check.sh index e47fbad..4bce6ac 100644 --- a/check.sh +++ b/check.sh @@ -33,7 +33,7 @@ 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/[^:]*://') TARGET_TAG=$(echo "${TARGET}" | sed 's/[^:]*://') -- 2.49.1 From 3823ddf8a6896c7a1ff80f1d27dbc10084422ae5 Mon Sep 17 00:00:00 2001 From: vista Date: Sun, 12 Mar 2023 11:48:37 +0100 Subject: [PATCH 5/5] Update '.woodpecker/build.yml' --- .woodpecker/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml index da82400..12bfb61 100644 --- a/.woodpecker/build.yml +++ b/.woodpecker/build.yml @@ -19,7 +19,6 @@ pipeline: password: from_secret: DOCKERHUB_TOKEN repo: vistanarvas/${CI_REPO_NAME} - tag: ${CI_COMMIT_BRANCH} auto_tag: true when: cron: nightly -- 2.49.1