Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Fix Docker push (#788)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirn authored Feb 7, 2019
1 parent 02dbd97 commit 5b9677b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@ jobs:
name: Publishing Docker image
command: |
set -xe
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
docker load -i ~/caches/docker-layers.tar
IMAGE_TAG=""
Expand All @@ -371,11 +374,13 @@ jobs:
esac
done
# In case the commit is HEAD of master branch, also tag stable.
# In case the commit is HEAD of latest version branch, also tag stable.
if [ -n "$CIRCLE_REPOSITORY_URL" ] && [ -n "$CIRCLE_SHA1" ]; then
_ref="refs/heads/master"
_head="$(git ls-remote "$CIRCLE_REPOSITORY_URL" "$_ref" | awk '{ print $1 }')"
if [ "$CIRCLE_SHA1" = "$_head" ]; then
_stable_head="$(
git ls-remote --heads "$CIRCLE_REPOSITORY_URL" "v*" |
awk '/refs\/heads\/v[0-9]+\.[0-9]+$/ { LH=$1 } END { print LH }')"
if [ "$CIRCLE_SHA1" = "$_stable_head" ]; then
IMAGE_TAG="stable $IMAGE_TAG"
fi
fi
Expand All @@ -398,7 +403,7 @@ jobs:
fi
for tag in $IMAGE_TAG; do
printf "\\033[0;34mPublishing Docker image as %s\\033[0;0m\\n" "$IMAGE_TAG"
printf "\\033[0;34mPublishing Docker image as %s\\033[0;0m\\n" "$tag"
docker tag "$IMAGE_NAME" "$IMAGE_NAME:$tag"
docker push "$IMAGE_NAME:$tag"
done
Expand Down Expand Up @@ -436,7 +441,7 @@ workflows:
branches:
ignore:
- master
- /^v.*/
- /^v[0-9]+\.[0-9]+/
- /.*e2e$/
tags:
ignore: /^v.*/
Expand All @@ -450,10 +455,10 @@ workflows:
branches:
only:
- master
- /^v.*/
- /^v[0-9]+\.[0-9]+/
- /.*e2e$/
tags:
only: /^v.*/
only: /^v[0-9]+\.[0-9]+\.[0-9]+/
- test_e2e:
requires:
- build
Expand Down
2 changes: 1 addition & 1 deletion docker-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if [ -z "$IMAGE_NAME" ]; then
if [ $DEV_MODE = 1 ]; then
IMAGE_NAME="omisegoimages/ewallet-builder:v1.1"
else
IMAGE_NAME="omisego/ewallet:v1.1.0"
IMAGE_NAME="omisego/ewallet:1.1.0"
fi
fi

Expand Down

0 comments on commit 5b9677b

Please sign in to comment.