-
Notifications
You must be signed in to change notification settings - Fork 3
88 lines (72 loc) · 3.35 KB
/
update-charts-dispatch.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Update application version on dispatch
on:
repository_dispatch:
types:
[
trigger-workflow-testkube-cloud-api-main,
trigger-workflow-testkube-cloud-ui-main,
trigger-workflow-testkube-worker-service-main,
trigger-workflow-testkube-logs-service-main,
trigger-workflow-testkube-agent-main
]
jobs:
release-helm-charts:
name: Release Helm charts
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config --global user.name "testkube-cloud-ci-bot"
git config --global user.email "testkube-cloud-ci-bot@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: v3.10.0
- name: Update Helm chart with changes files
if: github.event.action != 'trigger-workflow-testkube-agent-main'
run: |
# update application version
./scripts/update.sh \
-c ${{ github.event.client_payload.app }} \
-a ${{ github.event.client_payload.appVersion }} \
--verbose
echo -e "### ${{ github.event.client_payload.app }} Helm chart diff" >> $GITHUB_STEP_SUMMARY
echo -e '```' >> $GITHUB_STEP_SUMMARY
git --no-pager diff >> $GITHUB_STEP_SUMMARY
echo -e '```' >> $GITHUB_STEP_SUMMARY
# update helm chart version
new_chart_version=$(./scripts/update.sh -c ${{ github.event.client_payload.app }} --print-chart-version)
echo "CHART_VERSION=$new_chart_version" >> $GITHUB_ENV
- name: Update Agent version
if: github.event.action == 'trigger-workflow-testkube-agent-main'
run: |
echo "Bumping testkube-enterprise and Agent Helm-chart version"
./scripts/update.sh -c testkube-enterprise -g ${{ github.event.client_payload.agentVersion }}
# update Chart.lock
helm dependency update charts/testkube-enterprise
- name: Sync & Update Testkube Enterprise Helm chart
if: github.event.action != 'trigger-workflow-testkube-agent-main'
run: |
echo "Syncing subchart versions in testkube-enterprise Helm chart"
./scripts/sync.sh
echo "Bumping testkube-enterprise Helm-chart version"
./scripts/update.sh -c testkube-enterprise --strategy patch
enterprise_chart_version=$(./scripts/update.sh -c testkube-enterprise --print-chart-version)
echo "ENTERPRISE_CHART_VERSION=$enterprise_chart_version" >> $GITHUB_ENV
echo -e "### Testkube Enterprise Helm chart diff" >> $GITHUB_STEP_SUMMARY
echo -e '```' >> $GITHUB_STEP_SUMMARY
git --no-pager diff charts/testkube-enterprise >> $GITHUB_STEP_SUMMARY
echo -e '```' >> $GITHUB_STEP_SUMMARY
- name: Check for changes in generated Helm docs models (helm-docs)
run: |
./scripts/helm-docs.sh
- name: Commit & push changes
run: |
git status
git add **/*Chart.yaml **/*README.md charts/testkube-enterprise/Chart.lock charts/testkube-enterprise/profiles/values.demo.yaml **/*values.yaml
git commit -m "updating testkube-enterprise chart version to ${{ env.ENTERPRISE_CHART_VERSION }}"
git push --force