From 11a8c55183c16e09f16dc685126d1e2137f87c00 Mon Sep 17 00:00:00 2001 From: bobjwalker Date: Fri, 9 Feb 2024 17:44:44 -0600 Subject: [PATCH 01/15] Tiny workflow change --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3663624..b6bd8c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,7 @@ jobs: uses: gittools/actions/gitversion/execute@v0.9.14 with: additionalArguments: /overrideconfig mode=Mainline - - name: update tag + - name: update tag with latest version uses: richardsimko/update-tag@v1 with: tag_name: ${{ steps.determine_version.outputs.semVer }} From 15fca3782f2097cc3a2f093d55ced2a438b25e64 Mon Sep 17 00:00:00 2001 From: BobJWalker Date: Fri, 9 Feb 2024 23:46:01 +0000 Subject: [PATCH 02/15] Updating the Kustomize overlay to 0.1.56-one-test.1 Files changed: M k8s/overlays/dev/kustomization.yaml --- k8s/overlays/dev/kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/overlays/dev/kustomization.yaml b/k8s/overlays/dev/kustomization.yaml index c20f408..2176ee2 100644 --- a/k8s/overlays/dev/kustomization.yaml +++ b/k8s/overlays/dev/kustomization.yaml @@ -10,7 +10,7 @@ secretGenerator: images: - name: bobjwalker99/randomquotes-k8s newName: bobjwalker99/randomquotes-k8s - newTag: "0.1.53-triggers.2" + newTag: "0.1.56-one-test.1" patches: - target: kind: Ingress From 3c75736cc98c2ee9dad65a8836e0d2d918eac28e Mon Sep 17 00:00:00 2001 From: BobJWalker Date: Mon, 12 Feb 2024 15:51:47 +0000 Subject: [PATCH 03/15] Updating the Kustomize overlay to 0.1.56-one-test.3 Files changed: M k8s/overlays/dev/kustomization.yaml --- k8s/overlays/dev/kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/overlays/dev/kustomization.yaml b/k8s/overlays/dev/kustomization.yaml index 2176ee2..b9e75db 100644 --- a/k8s/overlays/dev/kustomization.yaml +++ b/k8s/overlays/dev/kustomization.yaml @@ -10,7 +10,7 @@ secretGenerator: images: - name: bobjwalker99/randomquotes-k8s newName: bobjwalker99/randomquotes-k8s - newTag: "0.1.56-one-test.1" + newTag: "0.1.56-one-test.3" patches: - target: kind: Ingress From d53210205787e3d2b012b754d609bca6ad5067a0 Mon Sep 17 00:00:00 2001 From: BobJWalker Date: Mon, 12 Feb 2024 15:56:30 +0000 Subject: [PATCH 04/15] Updating the Kustomize overlay to 0.1.56-one-test.6 Files changed: M k8s/overlays/dev/kustomization.yaml --- k8s/overlays/dev/kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/overlays/dev/kustomization.yaml b/k8s/overlays/dev/kustomization.yaml index b9e75db..0afd69a 100644 --- a/k8s/overlays/dev/kustomization.yaml +++ b/k8s/overlays/dev/kustomization.yaml @@ -10,7 +10,7 @@ secretGenerator: images: - name: bobjwalker99/randomquotes-k8s newName: bobjwalker99/randomquotes-k8s - newTag: "0.1.56-one-test.3" + newTag: "0.1.56-one-test.6" patches: - target: kind: Ingress From e17d7621ea24184d48ac67e56bc365d642568df5 Mon Sep 17 00:00:00 2001 From: bobjwalker Date: Mon, 12 Feb 2024 10:10:11 -0600 Subject: [PATCH 05/15] Using a new action to commit changes that supports tags --- .github/workflows/build.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6bd8c3..cb79a6a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,13 +58,24 @@ jobs: with: cmd: yq -i '.images.[0].newTag = "${{ steps.determine_version.outputs.semVer }}"' 'k8s/overlays/dev/kustomization.yaml' if: contains(github.ref, 'feature') + - id: commit_dev_kustomize_change + name: commit the dev kustomize change + uses: EndBug/add-and-commit@v9 + with: + add: 'k8s/overlays/dev/kustomization.yaml' + message: 'Updating dev overlay image tag to ${{ steps.determine_version.outputs.semVer }}' + tag: 'dev-argo' + tag_push: '--force' + if: contains(github.ref, 'feature') - name: update test kustomize overlay uses: mikefarah/yq@master with: cmd: yq -i '.images.[0].newTag = "${{ steps.determine_version.outputs.semVer }}"' 'k8s/overlays/test/kustomization.yaml' - if: github.ref == 'refs/heads/main' - - name: commit the kustomize change for Argo to trigger - uses: devops-infra/action-commit-push@master + if: github.ref == 'refs/heads/main' + - id: commit_test_kustomize_change + name: commit the test kustomize change + uses: EndBug/add-and-commit@v9 with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - commit_message: "Updating the ${{ steps.EnvOverlay.outputs.KUSTOMIZE_ENVIRONMENT }} Kustomize overlay to ${{ steps.determine_version.outputs.semVer }}" \ No newline at end of file + add: 'k8s/overlays/test/kustomization.yaml' + message: 'Updating test overlay image tag to ${{ steps.determine_version.outputs.semVer }}' + if: github.ref == 'refs/heads/main' \ No newline at end of file From 47a940d8c10b0d1e7f3bb39295d2efab32c418e3 Mon Sep 17 00:00:00 2001 From: bobjwalker Date: Mon, 12 Feb 2024 10:24:12 -0600 Subject: [PATCH 06/15] Trying to set the branch name to the current branch --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb79a6a..50a7ac2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,8 @@ jobs: add: 'k8s/overlays/dev/kustomization.yaml' message: 'Updating dev overlay image tag to ${{ steps.determine_version.outputs.semVer }}' tag: 'dev-argo' - tag_push: '--force' + tag_push: '--fa' + new_branch: ${{ github.ref }} if: contains(github.ref, 'feature') - name: update test kustomize overlay uses: mikefarah/yq@master From 0754292d34c963ed0738fca1ccd70f85ba884d11 Mon Sep 17 00:00:00 2001 From: bobjwalker Date: Mon, 12 Feb 2024 10:30:44 -0600 Subject: [PATCH 07/15] moving the force command around --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50a7ac2..149ba25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,8 +64,7 @@ jobs: with: add: 'k8s/overlays/dev/kustomization.yaml' message: 'Updating dev overlay image tag to ${{ steps.determine_version.outputs.semVer }}' - tag: 'dev-argo' - tag_push: '--fa' + tag: 'dev-argo --force' new_branch: ${{ github.ref }} if: contains(github.ref, 'feature') - name: update test kustomize overlay From 7a47130e04d2e7632bc7da81d165d1ca22f8d857 Mon Sep 17 00:00:00 2001 From: bobjwalker Date: Mon, 12 Feb 2024 10:58:08 -0600 Subject: [PATCH 08/15] Not setting the new branch --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 149ba25..863ac25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,6 @@ jobs: add: 'k8s/overlays/dev/kustomization.yaml' message: 'Updating dev overlay image tag to ${{ steps.determine_version.outputs.semVer }}' tag: 'dev-argo --force' - new_branch: ${{ github.ref }} if: contains(github.ref, 'feature') - name: update test kustomize overlay uses: mikefarah/yq@master From d94f88ac726aa0be2695fe2ff71ed298a3bc9e98 Mon Sep 17 00:00:00 2001 From: bobjwalker Date: Mon, 12 Feb 2024 11:13:59 -0600 Subject: [PATCH 09/15] Let's just do some manual git commands --- .github/workflows/build.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 863ac25..493cde1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,11 +60,15 @@ jobs: if: contains(github.ref, 'feature') - id: commit_dev_kustomize_change name: commit the dev kustomize change - uses: EndBug/add-and-commit@v9 - with: - add: 'k8s/overlays/dev/kustomization.yaml' - message: 'Updating dev overlay image tag to ${{ steps.determine_version.outputs.semVer }}' - tag: 'dev-argo --force' + run : | + git config --global user.name '${{ github.actor }}' + git config --global user.email '${{ github.actor }}@users.noreply.github.com' + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY + git checkout "${GITHUB_REF:11}" + git stage 'k8s/overlays/dev/kustomization.yaml' + git commit -am "Automated report" + git tag 'dev-argo' --force + git push if: contains(github.ref, 'feature') - name: update test kustomize overlay uses: mikefarah/yq@master From 6994eaaf0df6c39b4b8a1550127a414b6a6279e7 Mon Sep 17 00:00:00 2001 From: bobjwalker Date: Mon, 12 Feb 2024 11:18:41 -0600 Subject: [PATCH 10/15] Setting the upstream origin --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 493cde1..dc25905 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,7 +68,7 @@ jobs: git stage 'k8s/overlays/dev/kustomization.yaml' git commit -am "Automated report" git tag 'dev-argo' --force - git push + git push --set-upstream origin ${GITHUB_REF:11} if: contains(github.ref, 'feature') - name: update test kustomize overlay uses: mikefarah/yq@master From 470c13ecbde9cd86f7bbe3eb01304c1e4b8a8e33 Mon Sep 17 00:00:00 2001 From: BobJWalker Date: Mon, 12 Feb 2024 17:19:44 +0000 Subject: [PATCH 11/15] Automated report --- k8s/overlays/dev/kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/overlays/dev/kustomization.yaml b/k8s/overlays/dev/kustomization.yaml index 0afd69a..83c3716 100644 --- a/k8s/overlays/dev/kustomization.yaml +++ b/k8s/overlays/dev/kustomization.yaml @@ -10,7 +10,7 @@ secretGenerator: images: - name: bobjwalker99/randomquotes-k8s newName: bobjwalker99/randomquotes-k8s - newTag: "0.1.56-one-test.6" + newTag: "0.1.56-one-test.57" patches: - target: kind: Ingress From b4fd041eab39ec2e82c56c6fec3899829cbec7e0 Mon Sep 17 00:00:00 2001 From: bobjwalker Date: Mon, 12 Feb 2024 11:22:48 -0600 Subject: [PATCH 12/15] adding the pushing of tags to origin --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc25905..093295d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,9 +66,10 @@ jobs: git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY git checkout "${GITHUB_REF:11}" git stage 'k8s/overlays/dev/kustomization.yaml' - git commit -am "Automated report" + git commit -am "Updating dev overlay file to ${{ steps.determine_version.outputs.semVer }}" git tag 'dev-argo' --force - git push --set-upstream origin ${GITHUB_REF:11} + git push --set-upstream origin ${GITHUB_REF:11} + git push origin 'dev-argo' --force if: contains(github.ref, 'feature') - name: update test kustomize overlay uses: mikefarah/yq@master From 1bd65e4420e36f9a012020f83abcc6d501c2f2e2 Mon Sep 17 00:00:00 2001 From: BobJWalker Date: Mon, 12 Feb 2024 17:23:54 +0000 Subject: [PATCH 13/15] Updating dev overlay file to 0.1.56-one-test.71 --- k8s/overlays/dev/kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/overlays/dev/kustomization.yaml b/k8s/overlays/dev/kustomization.yaml index 83c3716..b40cf57 100644 --- a/k8s/overlays/dev/kustomization.yaml +++ b/k8s/overlays/dev/kustomization.yaml @@ -10,7 +10,7 @@ secretGenerator: images: - name: bobjwalker99/randomquotes-k8s newName: bobjwalker99/randomquotes-k8s - newTag: "0.1.56-one-test.57" + newTag: "0.1.56-one-test.71" patches: - target: kind: Ingress From bd132d960f713fa34da009c839fb9e976eb2a0ad Mon Sep 17 00:00:00 2001 From: bobjwalker Date: Mon, 12 Feb 2024 13:37:51 -0600 Subject: [PATCH 14/15] Updating test commit step --- .github/workflows/build.yml | 12 ++++++++---- .github/workflows/deploy-dev-argo.yml | 18 ------------------ 2 files changed, 8 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/deploy-dev-argo.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 093295d..bbd8dd0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,8 +78,12 @@ jobs: if: github.ref == 'refs/heads/main' - id: commit_test_kustomize_change name: commit the test kustomize change - uses: EndBug/add-and-commit@v9 - with: - add: 'k8s/overlays/test/kustomization.yaml' - message: 'Updating test overlay image tag to ${{ steps.determine_version.outputs.semVer }}' + run : | + git config --global user.name '${{ github.actor }}' + git config --global user.email '${{ github.actor }}@users.noreply.github.com' + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY + git checkout "${GITHUB_REF:11}" + git stage 'k8s/overlays/test/kustomization.yaml' + git commit -am "Updating test overlay file to ${{ steps.determine_version.outputs.semVer }}" + git push --set-upstream origin ${GITHUB_REF:11} if: github.ref == 'refs/heads/main' \ No newline at end of file diff --git a/.github/workflows/deploy-dev-argo.yml b/.github/workflows/deploy-dev-argo.yml deleted file mode 100644 index 33204d7..0000000 --- a/.github/workflows/deploy-dev-argo.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Deploy Dev Argo - -on: - workflow_run: - workflows: [Build Container] - types: [completed] - branches: [feature/**] - workflow_dispatch: - -jobs: - update-argo-tag: - runs-on: ubuntu-latest - steps: - - name: "Update tag" - uses: jimeh/update-tags-action@v1 - with: - tags: | - "dev-argo" \ No newline at end of file From 0952832af9e58029cbafe0306f4683e49f314057 Mon Sep 17 00:00:00 2001 From: BobJWalker Date: Mon, 12 Feb 2024 19:38:55 +0000 Subject: [PATCH 15/15] Updating dev overlay file to 0.1.56-one-test.87 --- k8s/overlays/dev/kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/overlays/dev/kustomization.yaml b/k8s/overlays/dev/kustomization.yaml index b40cf57..5257295 100644 --- a/k8s/overlays/dev/kustomization.yaml +++ b/k8s/overlays/dev/kustomization.yaml @@ -10,7 +10,7 @@ secretGenerator: images: - name: bobjwalker99/randomquotes-k8s newName: bobjwalker99/randomquotes-k8s - newTag: "0.1.56-one-test.71" + newTag: "0.1.56-one-test.87" patches: - target: kind: Ingress