Skip to content

Commit c9d540d

Browse files
committed
Modifies values file on CD step
1 parent 64db61f commit c9d540d

10 files changed

Lines changed: 19 additions & 11 deletions

File tree

.github/workflows/cicd.yaml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,45 @@ jobs:
1111
ci:
1212
runs-on: ubuntu-latest
1313
steps:
14-
-
15-
name: Shorten commit id
14+
- name: Shorten commit id
1615
shell: bash
1716
run: |
1817
echo "COMMIT_ID=${GITHUB_SHA::6}" >> "$GITHUB_ENV"
19-
-
20-
name: Login to Docker Hub
18+
- name: Login to Docker Hub
2119
uses: docker/login-action@v3
2220
with:
2321
username: ${{ secrets.DOCKERHUB_USERNAME }}
2422
password: ${{ secrets.DOCKERHUB_TOKEN }}
25-
-
26-
name: Build and push
23+
- name: Build and push
2724
uses: docker/build-push-action@v6
2825
with:
2926
push: true
3027
tags: tyrelfecha/python-app:${{ env.COMMIT_ID }}
28+
outputs:
29+
commit_id: ${{ env.COMMIT_ID }}
3130

3231
cd:
3332
needs: ci
3433
runs-on: self-hosted
3534
steps:
36-
-
37-
name: Install argocd
35+
- uses: actions/checkout@v2
36+
- name: Modify values file
37+
shell: bash
38+
run: |
39+
echo ${{needs.ci.outputs.commit_id}}
40+
pip install yq
41+
yq -Yi '.image.tag = "${{needs.ci.outputs.commit_id}}"' charts/python-app/values.yaml
42+
- name: Commit changes
43+
uses: EndBug/add-and-commit@v9
44+
with:
45+
message: 'Updates values.yaml with commit ${{needs.ci.outputs.commit_id}}'
46+
- name: Install argocd
3847
shell: bash
3948
run: |
4049
curl -ksSL -o argocd-linux-amd64 https://argocd-server.argocd/download/argocd-linux-amd64
4150
chmod +x argocd-linux-amd64
4251
sudo mv argocd-linux-amd64 /usr/local/bin/argocd
43-
-
44-
name: Argocd app sync
52+
- name: Argocd app sync
4553
shell: bash
4654
run: |
4755
argocd login argocd-server.argocd \
File renamed without changes.

src/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def details():
1010
return jsonify({
1111
'time': datetime.datetime.now().strftime("%I:%M:%S%p on %B %d, %Y"),
1212
'hostname': socket.gethostname(),
13-
'message': 'You are doing great, human!!! :)'
13+
'message': 'You are doing great, human!!! <3'
1414
})
1515

1616
@app.route('/api/v1/healthz')

0 commit comments

Comments
 (0)