Skip to content

Commit

Permalink
Add major,minor,patch versioning to our docker images (#9191)
Browse files Browse the repository at this point in the history
* Add major,minor,patch versioning to our docker images

* Push all tags simultaneously
  • Loading branch information
castrapel authored Jul 30, 2021
1 parent 2e3aed5 commit a16241b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/docker-publish-dockerhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,27 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v1.1.1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.CONSOLEME_DOCKERHUB_USERNAME }}
password: ${{ secrets.CONSOLEME_DOCKERHUB_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: consoleme/consoleme:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Build ConsoleMe
run: |
docker build -t consoleme .
- name: Tag, and push image to DockerHub
run: |
export CONSOLEME_VERSION=$(python setup.py -q --version)
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")
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 push --all-tags consoleme/consoleme
deploy_consoleme_demo_site:
name: Deploy Demo Site
if: github.repository == 'Netflix/consoleme'
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/docker-publish-ecr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,13 @@ jobs:
docker build -t consoleme .
- name: Tag, and push image to Amazon ECR
run: |
export CONSOLEME_VERSION=$(python setup.py -q --version)
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")
docker tag consoleme:latest public.ecr.aws/consoleme/consoleme:latest
docker push 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 push --all-tags public.ecr.aws/consoleme/consoleme

0 comments on commit a16241b

Please sign in to comment.