-
Notifications
You must be signed in to change notification settings - Fork 3
122 lines (101 loc) · 4.75 KB
/
chart-release.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Release Helm charts
on:
workflow_run:
workflows: [ "Update application version on dispatch" ]
types:
- completed
push:
branches:
- main
paths-ignore:
- "**/.argocd-source-*"
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 "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: v3.10.0
- name: Update Helm chart with changes files
run: |
echo "Testkube Helm charts diff"
changed_files=$(git --no-pager diff HEAD~1 charts)
if [[ "$changed_files" == *"testkube-cloud-api/"* ]]; then
echo "Changes detected in files within the 'testkube-cloud-api' directory. Updating the chart minor version."
./scripts/update.sh -c testkube-cloud-api --strategy minor
else
echo "No changes detected in the specified directories."
fi
if [[ "$changed_files" == *"testkube-cloud-ui/"* ]]; then
echo "Changes detected in files within the 'testkube-cloud-ui' directory. Updating the chart minor version."
./scripts/update.sh -c testkube-cloud-ui --strategy minor
else
echo "No changes detected in the specified directories."
fi
if [[ "$changed_files" == *"testkube-logs-service/"* ]]; then
echo "Changes detected in files within the 'testkube-logs-service' directory. Updating the chart minor version."
./scripts/update.sh -c testkube-logs-service --strategy minor
else
echo "No changes detected in the specified directories."
fi
if [[ "$changed_files" == *"testkube-worker-service/"* ]]; then
echo "Changes detected in files within the 'testkube-worker-service' directory. Updating the chart minor version."
./scripts/update.sh -c testkube-worker-service --strategy minor
else
echo "No changes detected in the specified directories."
fi
tk_api_chart_version=$(./scripts/update.sh -c testkube-cloud-api --print-chart-version)
echo "New testkube-cloud-api chart version is $tk_api_chart_version" >> $GITHUB_STEP_SUMMARY
echo "API_CHART_VERSION=$tk_api_chart_version" >> $GITHUB_ENV
tk_ui_chart_version=$(./scripts/update.sh -c testkube-cloud-ui --print-chart-version)
echo "New testkube-cloud-ui chart version is $tk_ui_chart_version" >> $GITHUB_STEP_SUMMARY
echo "UI_CHART_VERSION=$tk_ui_chart_version" >> $GITHUB_ENV
- name: Sync & Update Testkube Enterprise Helm chart
run: |
bump_strategy="minor"
changed=$(git status --porcelain charts/testkube-enterprise | wc -l)
if [ $changed -gt 0 ]; then
bump_strategy="none"
fi
echo "Syncing subchart versions in testkube-enterprise Helm chart"
./scripts/sync.sh
echo "Updating testkube-enterprise Helm chart version with bump strategy: $bump_strategy"
./scripts/update.sh -c testkube-enterprise -s $bump_strategy --verbose
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 **/*values.yaml
git commit -m "updating testkube-enterprise chart version to ${{ env.ENTERPRISE_CHART_VERSION }}"
git push --force
- name: Installing repositories
run: |
helm repo add dex https://charts.dexidp.io
helm repo add nats https://nats-io.github.io/k8s/helm/charts/
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add kubeshop https://kubeshop.github.io/helm-charts
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: charts
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CR_SKIP_EXISTING: true