Skip to content

Commit 78617f6

Browse files
authored
Merge pull request #1 from SheplX/stage
Stage
2 parents e8a32e9 + 0b23807 commit 78617f6

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

.github/workflows/Backend.CI.yaml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ on:
1717

1818
env:
1919
BACKEND_IMAGE: backend
20-
SHORT_SHA: $(echo "${{ github.sha }}" | cut -c1-7)
20+
SHORT_SHA: ${GITHUB_SHA::7}
2121

2222
jobs:
2323
TODO-BACKEND-CI:
2424
runs-on: ubuntu-latest
25+
env:
26+
SHA12: ${GITHUB_SHA::12}
2527
steps:
2628
- name: Checkout code
2729
uses: actions/checkout@v2
@@ -55,47 +57,49 @@ jobs:
5557
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
5658

5759
- name: Push Image Tag
60+
id: push_image_tag
5861
run: |
5962
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$BACKEND_IMAGE
6063
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
61-
VERSION=$GITHUB_SHA
64+
VERSION=${GITHUB_SHA:0:7}
6265
echo IMAGE_ID=$IMAGE_ID
6366
echo VERSION=$VERSION
6467
docker tag $BACKEND_IMAGE $IMAGE_ID:$VERSION
6568
docker push $IMAGE_ID:$VERSION
69+
echo "::set-output name=VERSION::$VERSION"
6670
6771
- name: Update Helm Chart Values at Main
6872
if: ${{ github.ref == 'refs/heads/main'}}
6973
uses: Nextdoor/helm-set-image-tag-action@main
7074
with:
7175
values_files: charts/values.yaml
7276
tag_keys: .backend.tag
73-
tag_value: ${{ github.sha }}
77+
tag_value: ${{ steps.push_image_tag.outputs.VERSION }}
7478
commit_branch: ${{ github.ref }}
75-
commit_tag: Todo-Main-Charts
76-
commit_message: "Tag Backend:${{ env.SHORT_SHA }} Pumped"
79+
commit_tag: Todo-Main-Charts-V-${{ steps.push_image_tag.outputs.VERSION }}
80+
commit_message: "Backend update: Tag '${{ steps.push_image_tag.outputs.VERSION }}' added"
7781

7882
- name: Update Helm Chart Values at Stage
7983
if: ${{ github.ref == 'refs/heads/stage'}}
8084
uses: Nextdoor/helm-set-image-tag-action@main
8185
with:
8286
values_files: charts/values.yaml
8387
tag_keys: .backend.tag
84-
tag_value: ${{ github.sha }}
88+
tag_value: ${{ steps.push_image_tag.outputs.VERSION }}
8589
commit_branch: ${{ github.ref }}
86-
commit_tag: Todo-Stage-Charts
87-
commit_message: "Tag Backend:${{ env.SHORT_SHA }} Pumped"
90+
commit_tag: Todo-Stage-Charts-V-${{ steps.push_image_tag.outputs.VERSION }}
91+
commit_message: "Backend update: Tag '${{ steps.push_image_tag.outputs.VERSION }}' added"
8892

8993
- name: Update Helm Chart Values at Dev
9094
if: ${{ github.ref == 'refs/heads/dev'}}
9195
uses: Nextdoor/helm-set-image-tag-action@main
9296
with:
9397
values_files: charts/values.yaml
9498
tag_keys: .backend.tag
95-
tag_value: ${{ github.sha }}
99+
tag_value: ${{ steps.push_image_tag.outputs.VERSION }}
96100
commit_branch: ${{ github.ref }}
97-
commit_tag: Todo-Dev-Charts
98-
commit_message: "Tag Backend:${{ env.SHORT_SHA }} Pumped"
101+
commit_tag: Todo-Dev-Charts-V-${{ steps.push_image_tag.outputs.VERSION }}
102+
commit_message: "Backend update: Tag '${{ steps.push_image_tag.outputs.VERSION }}' added"
99103

100104
# - name: 'Updating Helm Charts values on branch main'
101105
# if: ${{ github.ref == 'refs/heads/main' }}

charts/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ appVersion: 1.16.0
33
description: Todo app Helm chart
44
name: Todo app
55
type: application
6-
version: 0.1.79
6+
version: 0.1.87

charts/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Todo app
22

3-
![Version: 0.1.79](https://img.shields.io/badge/Version-0.1.79-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square)
3+
![Version: 0.1.87](https://img.shields.io/badge/Version-0.1.87-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square)
44

55
Todo app Helm chart
66

@@ -10,7 +10,7 @@ Todo app Helm chart
1010
|-----|------|---------|-------------|
1111
| DBname.name | string | `"db"` | |
1212
| backend.repository | string | `"docker.pkg.github.com/Todo-Full-Stack-Deployment/sheplx/backend"` | |
13-
| backend.tag | string | `"d5b6b6dc38ac8ac2c6aacf4552b75a6cbf65b205"` | |
13+
| backend.tag | string | `"cd43314"` | |
1414
| frontend.repository | string | `"docker.pkg.github.com/Todo-Full-Stack-Deployment/sheplx/frontend"` | |
1515
| frontend.tag | string | `"c8dd64edf28cdfa5c7c8b95b581e2549857a5ee8"` | |
1616
| ingress.tls[0].hosts[0] | string | `"todo.devops.com"` | |

charts/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ingress:
44
- todo.devops.com
55
backend:
66
repository: docker.pkg.github.com/Todo-Full-Stack-Deployment/sheplx/backend
7-
tag: d5b6b6dc38ac8ac2c6aacf4552b75a6cbf65b205
7+
tag: "cd43314"
88
frontend:
99
repository: docker.pkg.github.com/Todo-Full-Stack-Deployment/sheplx/frontend
1010
tag: c8dd64edf28cdfa5c7c8b95b581e2549857a5ee8

0 commit comments

Comments
 (0)