From 849f5c31020b4344e9a87f642b9bd4c80c268082 Mon Sep 17 00:00:00 2001 From: Denis P Date: Wed, 12 Jun 2019 12:11:49 +0200 Subject: [PATCH 1/3] if there,s git, it's fixed --- .gitlab-ci.yml | 2 +- scripts/docker/hub/publish-docker.sh | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33cfbd9d9fb..4640d8aafc3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -206,7 +206,7 @@ build-windows: publish-docker: stage: publish <<: *no_git - only: *releaseable_branches + # only: *releaseable_branches except: variables: - $SCHEDULE_TAG == "nightly" diff --git a/scripts/docker/hub/publish-docker.sh b/scripts/docker/hub/publish-docker.sh index 6602d55c23a..66cf9659d33 100755 --- a/scripts/docker/hub/publish-docker.sh +++ b/scripts/docker/hub/publish-docker.sh @@ -44,14 +44,15 @@ case "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" in --file tools/Dockerfile .; docker push "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}"; docker push "parity/parity:stable";; - *) - echo "Docker TAG - 'parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}'" + *) # case for tags and misc + BRANCH = $(git branch --contains ${CI_COMMIT_REF_NAME}) + echo "Docker TAG - 'parity/parity:${VERSION}-${BRANCH}'" docker build --no-cache \ --build-arg VCS_REF="${CI_COMMIT_SHA}" \ --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \ - --tag "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}" \ + --tag "parity/parity:${VERSION}-${BRANCH}" \ --file tools/Dockerfile .; - docker push "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}";; + docker push "parity/parity:${VERSION}-${BRANCH}";; esac docker logout From db908a4b2c9ca46cb3f6362dc98764dcc238805a Mon Sep 17 00:00:00 2001 From: Denis P Date: Wed, 12 Jun 2019 12:49:53 +0200 Subject: [PATCH 2/3] use TRACK --- scripts/docker/hub/publish-docker.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/docker/hub/publish-docker.sh b/scripts/docker/hub/publish-docker.sh index 66cf9659d33..c50e486ef7b 100755 --- a/scripts/docker/hub/publish-docker.sh +++ b/scripts/docker/hub/publish-docker.sh @@ -3,7 +3,9 @@ set -e # fail on any error VERSION=$(cat ./tools/VERSION) +TRACK=$(cat ./tools/TRACK) echo "Parity Ethereum version = ${VERSION}" +echo "Parity Ethereum track = ${TRACK}" test "$Docker_Hub_User_Parity" -a "$Docker_Hub_Pass_Parity" \ || ( echo "no docker credentials provided"; exit 1 ) @@ -44,15 +46,22 @@ case "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" in --file tools/Dockerfile .; docker push "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}"; docker push "parity/parity:stable";; - *) # case for tags and misc - BRANCH = $(git branch --contains ${CI_COMMIT_REF_NAME}) - echo "Docker TAG - 'parity/parity:${VERSION}-${BRANCH}'" + "^v[0-9]+\.[0-9]+.*$") # case for tags (TRACK=branch name) + echo "Docker TAG - 'parity/parity:${VERSION}-${TRACK}'" docker build --no-cache \ --build-arg VCS_REF="${CI_COMMIT_SHA}" \ --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \ - --tag "parity/parity:${VERSION}-${BRANCH}" \ + --tag "parity/parity:${VERSION}-${TRACK}" \ --file tools/Dockerfile .; - docker push "parity/parity:${VERSION}-${BRANCH}";; + docker push "parity/parity:${VERSION}-${TRACK}";; + *) + echo "Docker TAG - 'parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}'" + docker build --no-cache \ + --build-arg VCS_REF="${CI_COMMIT_SHA}" \ + --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \ + --tag "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}" \ + --file tools/Dockerfile .; + docker push "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}";; esac docker logout From 2c49c9ec79308a5eb0fe2a42cbb4a144d5586cb8 Mon Sep 17 00:00:00 2001 From: Denis P Date: Wed, 12 Jun 2019 17:38:13 +0200 Subject: [PATCH 3/3] proper glob --- .gitlab-ci.yml | 2 +- scripts/docker/hub/publish-docker.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4640d8aafc3..33cfbd9d9fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -206,7 +206,7 @@ build-windows: publish-docker: stage: publish <<: *no_git - # only: *releaseable_branches + only: *releaseable_branches except: variables: - $SCHEDULE_TAG == "nightly" diff --git a/scripts/docker/hub/publish-docker.sh b/scripts/docker/hub/publish-docker.sh index c50e486ef7b..84feedb2817 100755 --- a/scripts/docker/hub/publish-docker.sh +++ b/scripts/docker/hub/publish-docker.sh @@ -46,7 +46,7 @@ case "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" in --file tools/Dockerfile .; docker push "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}"; docker push "parity/parity:stable";; - "^v[0-9]+\.[0-9]+.*$") # case for tags (TRACK=branch name) + v[0-9]*.[0-9]*) echo "Docker TAG - 'parity/parity:${VERSION}-${TRACK}'" docker build --no-cache \ --build-arg VCS_REF="${CI_COMMIT_SHA}" \