Skip to content

Commit 740b1fa

Browse files
authored
Automate updatecli workflow (#407)
1 parent 3f978a7 commit 740b1fa

File tree

3 files changed

+96
-1
lines changed

3 files changed

+96
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
github:
3+
enabled: true

.github/updatecli.yaml

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
---
12
name: "Update Zammad version and dependency charts (patch and minor only)"
23

34
sources:
45
zammad:
6+
name: zammad
57
kind: dockerimage
68
spec:
79
image: "zammad/zammad-docker-compose"
810
architecture: "linux/amd64"
911
tagfilter: "^7\\.0\\.\\d-\\d{4}"
1012
alpine:
13+
name: alpine
1114
kind: dockerimage
1215
spec:
1316
image: "alpine"
@@ -16,34 +19,39 @@ sources:
1619
pattern: '3.x.x'
1720
kind: semver
1821
# elasticsearch:
22+
# name: elasticsearch
1923
# kind: helmchart
2024
# spec:
2125
# url: https://charts.bitnami.com/bitnami
2226
# name: elasticsearch
2327
# versionfilter:
2428
# pattern: "21.x.x"
2529
# minio:
30+
# name: minio
2631
# kind: helmchart
2732
# spec:
2833
# url: https://charts.bitnami.com/bitnami
2934
# name: minio
3035
# versionfilter:
3136
# pattern: "14.x.x"
3237
memcached:
38+
name: memcached
3339
kind: helmchart
3440
spec:
3541
url: oci://ghcr.io/cloudpirates-io/helm-charts
3642
name: memcached
3743
versionfilter:
3844
pattern: "0.x.x"
3945
# postgresql:
46+
# name: postgresql
4047
# kind: helmchart
4148
# spec:
4249
# url: https://charts.bitnami.com/bitnami
4350
# name: postgresql
4451
# versionfilter:
4552
# pattern: "16.x.x"
4653
redis:
54+
name: redis
4755
kind: helmchart
4856
spec:
4957
url: oci://ghcr.io/cloudpirates-io/helm-charts
@@ -55,57 +63,109 @@ conditions: {}
5563

5664
targets:
5765
zammad:
66+
name: zammad
5867
kind: helmchart
5968
sourceid: zammad
69+
# {{ if .github.enabled }}
70+
scmid: zammad-helm
71+
# {{ end }}
6072
spec:
6173
name: "zammad"
6274
file: "Chart.yaml"
6375
key: "$.appVersion"
6476
versionincrement: patch
6577
alpine:
78+
name: alpine
6679
kind: file
6780
sourceid: alpine
81+
# {{ if .github.enabled }}
82+
scmid: zammad-helm
83+
# {{ end }}
6884
spec:
6985
file: zammad/values.yaml
7086
matchpattern: ' tag: "\d+\.\d+\.\d+"'
7187
replacepattern: ' tag: "{{ source `alpine` }}"'
7288
# elasticsearch:
89+
# name: elasticsearch
7390
# kind: helmchart
7491
# sourceid: elasticsearch
92+
# # {{ if .github.enabled }}
93+
# scmid: zammad-helm
94+
# # {{ end }}
7595
# spec:
7696
# name: "zammad"
7797
# file: "Chart.yaml"
7898
# key: "$.dependencies[0].version"
7999
# versionincrement: patch
80100
# minio:
101+
# name: minio
81102
# kind: helmchart
82103
# sourceid: minio
104+
# # {{ if .github.enabled }}
105+
# scmid: zammad-helm
106+
# # {{ end }}
83107
# spec:
84108
# name: "zammad"
85109
# file: "Chart.yaml"
86110
# key: "$.dependencies[1].version"
87111
# versionincrement: patch
88112
memcached:
113+
name: memcached
89114
kind: helmchart
90115
sourceid: memcached
116+
# {{ if .github.enabled }}
117+
scmid: zammad-helm
118+
# {{ end }}
91119
spec:
92120
name: "zammad"
93121
file: "Chart.yaml"
94122
key: "$.dependencies[2].version"
95123
versionincrement: patch
96124
# postgresql:
125+
# name: postgresql
97126
# kind: helmchart
98127
# sourceid: postgresql
128+
# # {{ if .github.enabled }}
129+
# scmid: zammad-helm
130+
# # {{ end }}
99131
# spec:
100132
# name: "zammad"
101133
# file: "Chart.yaml"
102134
# key: "$.dependencies[3].version"
103135
# versionincrement: patch
104136
redis:
137+
name: redis
105138
kind: helmchart
106139
sourceid: redis
140+
# {{ if .github.enabled }}
141+
scmid: zammad-helm
142+
# {{ end }}
107143
spec:
108144
name: "zammad"
109145
file: "Chart.yaml"
110146
key: "$.dependencies[4].version"
111-
versionincrement: patch
147+
versionincrement: patch
148+
149+
# {{ if .github.enabled }}
150+
scms:
151+
zammad-helm:
152+
kind: "github"
153+
spec:
154+
owner: "zammad"
155+
repository: "zammad-helm"
156+
token: '{{ requiredEnv "UPDATECLI_GITHUB_TOKEN" }}'
157+
username: '{{ requiredEnv "UPDATECLI_GITHUB_ACTOR" }}'
158+
branch: "main"
159+
160+
actions:
161+
github:
162+
kind: github/pullrequest
163+
scmid: zammad-helm
164+
spec:
165+
automerge: false
166+
title: "Patch-level image updates"
167+
assignees:
168+
- mgruner
169+
labels:
170+
- "dependencies"
171+
# {{ end }}

.github/workflows/updatecli.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Update Dependencies via Updatecli
3+
4+
on:
5+
schedule:
6+
- cron: '0 2 * * 2' # every Tuesday at 2:00 am
7+
workflow_dispatch:
8+
9+
permissions:
10+
# Required by Updatecli to create Git Commit(s)
11+
contents: "write"
12+
# Required by Updatecli to open GitHub pull request
13+
pull-requests: "write"
14+
# Required by Updatecli to update GitHub action workflows
15+
actions: "write"
16+
17+
jobs:
18+
updatecli:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Install Updatecli
25+
uses: updatecli/updatecli-action@v2
26+
27+
- name: Run Updatecli
28+
run: |
29+
updatecli pipeline apply --config .github/updatecli.yaml --values .github/updatecli-values-enable-github.yaml
30+
env:
31+
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
UPDATECLI_GITHUB_ACTOR: ${{ github.actor }}

0 commit comments

Comments
 (0)