diff --git a/.github/workflows/docker-publish-dockerhub.yaml b/.github/workflows/docker-publish-dockerhub.yaml index 76b2f62fa..4d85d9cd0 100644 --- a/.github/workflows/docker-publish-dockerhub.yaml +++ b/.github/workflows/docker-publish-dockerhub.yaml @@ -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: @@ -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 diff --git a/.github/workflows/docker-publish-ecr.yml b/.github/workflows/docker-publish-ecr.yml index 07c218748..aded3fdb5 100644 --- a/.github/workflows/docker-publish-ecr.yml +++ b/.github/workflows/docker-publish-ecr.yml @@ -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: |- @@ -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: @@ -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