Skip to content

Commit d77351d

Browse files
authored
ci: add script to check for helm chart updates (#1827)
1 parent f99e49f commit d77351d

File tree

7 files changed

+478
-0
lines changed

7 files changed

+478
-0
lines changed
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: CI - helm chart update
2+
concurrency: ${{ github.workflow }}-${{ github.ref }}
3+
on:
4+
schedule:
5+
- cron: '30 0 * * *'
6+
7+
jobs:
8+
start-helm-update-ci:
9+
name: Helm chart minor update
10+
uses: ./.github/workflows/ci-helm-chart.yml
11+
secrets: inherit
12+
with:
13+
CI_UPDATE_TYPE: minor

.github/workflows/ci-helm-chart.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Helm chart updates
2+
on:
3+
workflow_call:
4+
inputs:
5+
CI_UPDATE_TYPE:
6+
type: string
7+
required: true
8+
CI_HELM_CHART_NAME_FILTER:
9+
type: string
10+
default: '[]'
11+
CI_GIT_BASELINE_BRANCH:
12+
type: string
13+
default: 'main'
14+
workflow_dispatch:
15+
inputs:
16+
CI_UPDATE_TYPE:
17+
description: 'Specify the type of update (e.g., patch, minor, major)'
18+
type: choice
19+
options:
20+
- patch
21+
- minor
22+
- major
23+
default: 'patch'
24+
CI_HELM_CHART_NAME_FILTER:
25+
description: 'Filter for Helm chart names (list in JSON format)'
26+
required: true
27+
default: '[]'
28+
CI_GIT_BASELINE_BRANCH:
29+
description: 'Baseline branch for Git operations'
30+
required: true
31+
default: 'main'
32+
33+
env:
34+
GIT_USER: svcAPLBot
35+
BOT_EMAIL: ${{ vars.BOT_EMAIL }}
36+
BOT_USERNAME: ${{ vars.BOT_USERNAME }}
37+
CHECK_CONTEXT: continuous-integration/integration-test
38+
COMMIT_ID: '${{ github.event.pull_request.head.sha || github.sha }}'
39+
jobs:
40+
preprocess-input:
41+
name: Helm chart update
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Print user input
45+
run: |
46+
echo 'CI_UPDATE_TYPE: ${{ inputs.CI_UPDATE_TYPE }}'
47+
echo 'CI_HELM_CHART_NAME_FILTER: ${{ inputs.CI_HELM_CHART_NAME_FILTER }}'
48+
echo 'CI_GIT_BASELINE_BRANCH: ${{ inputs.CI_GIT_BASELINE_BRANCH }}'
49+
- name: Set env
50+
run: |
51+
git config --global user.email $BOT_EMAIL
52+
git config --global user.name $BOT_USERNAME
53+
- name: Checkout repository
54+
uses: actions/checkout@v3
55+
- name: Set up Node.js
56+
uses: actions/setup-node@v3
57+
with:
58+
node-version: 20
59+
- name: Install packages
60+
run: |
61+
cd ci/
62+
npm install
63+
- name: Update helm charts
64+
env:
65+
CI_UPDATE_TYPE: ${{ inputs.CI_UPDATE_TYPE }}
66+
CI_HELM_CHART_NAME_FILTER: ${{ inputs.CI_HELM_CHART_NAME_FILTER }}
67+
CI_GIT_BASELINE_BRANCH: ${{ inputs.CI_GIT_BASELINE_BRANCH }}
68+
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
69+
run: |
70+
cd ci/
71+
npm run update-helm-chart-deps

ci/.env.sample

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CI_UPDATE_TYPE='minor'
2+
CI_HELM_CHART_NAME_FILTER='["cert-manager"]'
3+
CI_GH_CREATE_PR='false'
4+
CI_GIT_BASELINE_BRANCH='APL-11'
5+
CI_GIT_LOCAL_BRANCH_ONLY='true'

ci/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

ci/package-lock.json

+193
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/package.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"author": "Akamai",
3+
"bugs": {
4+
"url": "https://github.com/linode/apl-core/issues"
5+
},
6+
"dependencies": {
7+
"ajv": "8.17.1",
8+
"dotenv": "^16.4.7",
9+
"envalid": "8.0.0",
10+
"js-yaml": "^4.1.0",
11+
"semver": "^7.6.3",
12+
"yaml": "2.3.0-5",
13+
"zx": "^8.2.2"
14+
},
15+
"description": "CI scripts",
16+
"engines": {
17+
"node": ">=20 <21",
18+
"npm": "^10"
19+
},
20+
"homepage": "https://github.com/linode/apl-core#readme",
21+
"license": "Apache-2.0",
22+
"name": "apl-core",
23+
"private": true,
24+
"repository": {
25+
"type": "git",
26+
"url": "git+https://github.com/linode/apl-core.git"
27+
},
28+
"scripts": {
29+
"update-helm-chart-deps": "src/update-helm-chart-deps.mjs"
30+
},
31+
"type": "commonjs",
32+
"version": "1.0.0"
33+
}

0 commit comments

Comments
 (0)