Skip to content

Commit

Permalink
Fix docker image tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
castrapel committed Jul 30, 2021
1 parent 773c472 commit 310441c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/docker-publish-dockerhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1.1.1
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
Expand All @@ -20,17 +20,23 @@ jobs:
- name: Build ConsoleMe
run: |
docker build -t consoleme .
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Tag, and push image to DockerHub
run: |
export CONSOLEME_VERSION=$(python setup.py -q --version)
export CONSOLEME_VERSION=$(python3 setup.py -q --version | sed -r 's/\+/\./g')
export CONSOLEME_MAJOR=$(cut -d '.' -f 1 <<< "$CONSOLEME_VERSION")
export CONSOLEME_MINOR=$(cut -d '.' -f 1,2 <<< "$CONSOLEME_VERSION")
export CONSOLEME_PATCH=$(cut -d '.' -f 1,2,3 <<< "$CONSOLEME_VERSION")
export CONSOLEME_DEV=$(cut -d '.' -f 1,2,3,4 <<< "$CONSOLEME_VERSION")
docker tag consoleme:latest consoleme/consoleme:latest
docker tag consoleme:latest consoleme/consoleme:$CONSOLEME_VERSION
docker tag consoleme:latest consoleme/consoleme:$CONSOLEME_MAJOR
docker tag consoleme:latest consoleme/consoleme:$CONSOLEME_MINOR
docker tag consoleme:latest consoleme/consoleme:$CONSOLEME_PATCH
docker tag consoleme:latest consoleme/consoleme:$CONSOLEME_DEV
docker push --all-tags consoleme/consoleme
deploy_consoleme_demo_site:
name: Deploy Demo Site
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/docker-publish-ecr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
name: ECR public action
if: github.repository == 'Netflix/consoleme'
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v1
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9

- name: Install AWS CLI
run: |-
Expand All @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1.1.1
uses: docker/setup-buildx-action@v1

- name: Login to Public ECR
env:
Expand All @@ -34,13 +34,17 @@ jobs:
docker build -t consoleme .
- name: Tag, and push image to Amazon ECR
run: |
export CONSOLEME_VERSION=$(python setup.py -q --version)
# Extract tags from version
export CONSOLEME_VERSION=$(python3 setup.py -q --version | sed -r 's/\+/\./g')
export CONSOLEME_MAJOR=$(cut -d '.' -f 1 <<< "$CONSOLEME_VERSION")
export CONSOLEME_MINOR=$(cut -d '.' -f 1,2 <<< "$CONSOLEME_VERSION")
export CONSOLEME_PATCH=$(cut -d '.' -f 1,2,3 <<< "$CONSOLEME_VERSION")
export CONSOLEME_DEV=$(cut -d '.' -f 1,2,3,4 <<< "$CONSOLEME_VERSION")
# Tag image
docker tag consoleme:latest public.ecr.aws/consoleme/consoleme:latest
docker tag consoleme:latest public.ecr.aws/consoleme/consoleme:$CONSOLEME_VERSION
docker tag consoleme:latest public.ecr.aws/consoleme/consoleme:$CONSOLEME_MAJOR
docker tag consoleme:latest public.ecr.aws/consoleme/consoleme:$CONSOLEME_MINOR
docker tag consoleme:latest public.ecr.aws/consoleme/consoleme:$CONSOLEME_PATCH
docker tag consoleme:latest public.ecr.aws/consoleme/consoleme:CONSOLEME_DEV
docker push --all-tags public.ecr.aws/consoleme/consoleme

0 comments on commit 310441c

Please sign in to comment.