From fffeaefb695d6a86426147b857ab3e097e279613 Mon Sep 17 00:00:00 2001 From: ebronson68 <111298136+ebronson68@users.noreply.github.com> Date: Tue, 15 Aug 2023 11:15:16 -0500 Subject: [PATCH 1/6] Add tag name to dockerImageTag default value --- .github/workflows/aks-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aks-deploy.yaml b/.github/workflows/aks-deploy.yaml index 876ef627..17ba753d 100644 --- a/.github/workflows/aks-deploy.yaml +++ b/.github/workflows/aks-deploy.yaml @@ -45,7 +45,7 @@ on: required: false type: string description: "Docker image tag." - default: "${{ github.sha }}" + default: "${{ github.event.release.tag_name || github.sha }}" maximumReplicas: required: false type: string From d40458ee69201ccbb7b054d2fe2b484bda9f4281 Mon Sep 17 00:00:00 2001 From: ebronson68 <111298136+ebronson68@users.noreply.github.com> Date: Tue, 15 Aug 2023 11:50:39 -0500 Subject: [PATCH 2/6] Add latest and major release tags --- .github/workflows/aks-deploy.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/aks-deploy.yaml b/.github/workflows/aks-deploy.yaml index 17ba753d..70b6168c 100644 --- a/.github/workflows/aks-deploy.yaml +++ b/.github/workflows/aks-deploy.yaml @@ -238,8 +238,12 @@ jobs: - name: Build & Push Docker Image run: | - docker build ${{ inputs.dockerFilePath }} ${{ env.buildArguments }} -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" + docker build ${{ inputs.dockerFilePath }} ${{ env.buildArguments }} -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:latest" docker push "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" + if [[ "${{ inputs.dockerImageName }}" == "${{ github.event.release.tag_name }}" ]]; then + MAJOR_RELEASE=$(echo "${{ github.event.release.tag_name }}" | cut -d "." -f 1) + docker tag "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${MAJOR_RELEASE}" + fi - name: Create values override file run: | From 03bd86d42e34eb7f5bdeac50f4dd953ccfdbbcec Mon Sep 17 00:00:00 2001 From: ebronson68 <111298136+ebronson68@users.noreply.github.com> Date: Tue, 15 Aug 2023 11:58:28 -0500 Subject: [PATCH 3/6] Fix if condition --- .github/workflows/aks-deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/aks-deploy.yaml b/.github/workflows/aks-deploy.yaml index 70b6168c..2c1d1d78 100644 --- a/.github/workflows/aks-deploy.yaml +++ b/.github/workflows/aks-deploy.yaml @@ -239,11 +239,11 @@ jobs: - name: Build & Push Docker Image run: | docker build ${{ inputs.dockerFilePath }} ${{ env.buildArguments }} -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:latest" - docker push "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" - if [[ "${{ inputs.dockerImageName }}" == "${{ github.event.release.tag_name }}" ]]; then + if [[ "${{ inputs.dockerImageTag }}" == "${{ github.event.release.tag_name }}" ]]; then MAJOR_RELEASE=$(echo "${{ github.event.release.tag_name }}" | cut -d "." -f 1) docker tag "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${MAJOR_RELEASE}" fi + docker push "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" - name: Create values override file run: | From 0c518b7d2400e52af372b248fbdb3400392f6fbe Mon Sep 17 00:00:00 2001 From: ebronson68 <111298136+ebronson68@users.noreply.github.com> Date: Tue, 15 Aug 2023 14:03:16 -0500 Subject: [PATCH 4/6] Add "all-tags" option to docker push cmd --- .github/workflows/aks-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aks-deploy.yaml b/.github/workflows/aks-deploy.yaml index 2c1d1d78..ba664b12 100644 --- a/.github/workflows/aks-deploy.yaml +++ b/.github/workflows/aks-deploy.yaml @@ -243,7 +243,7 @@ jobs: MAJOR_RELEASE=$(echo "${{ github.event.release.tag_name }}" | cut -d "." -f 1) docker tag "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${MAJOR_RELEASE}" fi - docker push "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" + docker push -a "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" - name: Create values override file run: | From c4def6fa83c14caac6cb4de95aae4e53f173cd62 Mon Sep 17 00:00:00 2001 From: ebronson68 <111298136+ebronson68@users.noreply.github.com> Date: Tue, 15 Aug 2023 14:06:02 -0500 Subject: [PATCH 5/6] Resolving "tag can't be used with --all-tags" err --- .github/workflows/aks-deploy.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/aks-deploy.yaml b/.github/workflows/aks-deploy.yaml index ba664b12..aab9d1ca 100644 --- a/.github/workflows/aks-deploy.yaml +++ b/.github/workflows/aks-deploy.yaml @@ -238,10 +238,11 @@ jobs: - name: Build & Push Docker Image run: | - docker build ${{ inputs.dockerFilePath }} ${{ env.buildArguments }} -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:latest" if [[ "${{ inputs.dockerImageTag }}" == "${{ github.event.release.tag_name }}" ]]; then MAJOR_RELEASE=$(echo "${{ github.event.release.tag_name }}" | cut -d "." -f 1) - docker tag "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${MAJOR_RELEASE}" + docker build ${{ inputs.dockerFilePath }} ${{ env.buildArguments }} -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:latest" -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${MAJOR_RELEASE}" + else + docker build ${{ inputs.dockerFilePath }} ${{ env.buildArguments }} -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:latest" fi docker push -a "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" From 5b63f79fa3831f05c5b5b83d2c00d3a681684b75 Mon Sep 17 00:00:00 2001 From: ebronson68 <111298136+ebronson68@users.noreply.github.com> Date: Tue, 15 Aug 2023 14:09:59 -0500 Subject: [PATCH 6/6] Removing tag off of docker push cmd --- .github/workflows/aks-deploy.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/aks-deploy.yaml b/.github/workflows/aks-deploy.yaml index aab9d1ca..862d1b3b 100644 --- a/.github/workflows/aks-deploy.yaml +++ b/.github/workflows/aks-deploy.yaml @@ -238,13 +238,12 @@ jobs: - name: Build & Push Docker Image run: | + docker build ${{ inputs.dockerFilePath }} ${{ env.buildArguments }} -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:latest" if [[ "${{ inputs.dockerImageTag }}" == "${{ github.event.release.tag_name }}" ]]; then MAJOR_RELEASE=$(echo "${{ github.event.release.tag_name }}" | cut -d "." -f 1) - docker build ${{ inputs.dockerFilePath }} ${{ env.buildArguments }} -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:latest" -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${MAJOR_RELEASE}" - else - docker build ${{ inputs.dockerFilePath }} ${{ env.buildArguments }} -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" -t "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:latest" + docker tag "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${MAJOR_RELEASE}" fi - docker push -a "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}:${{ inputs.dockerImageTag }}" + docker push -a "${{ secrets.registryHostName }}/${{ inputs.dockerImageName }}" - name: Create values override file run: |