Skip to content

Commit

Permalink
build: add workflow to bump chartVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
joshiste committed Jan 29, 2024
1 parent f720e99 commit d42176e
Show file tree
Hide file tree
Showing 16 changed files with 95 additions and 49 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/bump-chart-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

name: Bump Chart Version
on:
workflow_call:
inputs:
chart:
type: string
required: true
description: The chart to bump the version for
app_version:
type: string
required: false
description: The optional app version to set

jobs:
bump-chart-version:
name: Bump Chart Patch Version on main branch
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: write
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_APP_STEADYBIT_APP_ID }}
private-key: ${{ secrets.GH_APP_STEADYBIT_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}

# this commit will effectively cause another run of the workflow which then actually performs the helm chart release
- run: |
npm install -g semver
make chart-bump-version CHART="${{ inputs.chart }}" APP_VERSION="${{ needs.build-images.outputs.version }}"
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git commit -am "chore: update helm chart version"
git push
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,18 @@ charttesting:
.PHONY: chartlint
chartlint:
ct lint --config chartTesting.yaml

## chart-bump-version: Bump the patch version and optionally set the appVersion
.PHONY: chart-bump-version
chart-bump-version:
@set -e; \
if [ ! -z "$(CHART)" ]; then\
echo "no chart specified"; \
exit 1; \
fi; \
if [ ! -z "$(APP_VERSION)" ]; then \
yq -i ".appVersion = strenv(APP_VERSION)" $(CHART)/Chart.yaml; \
fi; \
CHART_VERSION=$$(semver -i patch $$(yq '.version' $(CHART)/Chart.yaml)) \
yq -i ".version = strenv(CHART_VERSION)" $(CHART)/Chart.yaml; \
grep -e "^version:" -e "^appVersion:" $(CHART)/Chart.yaml; \
4 changes: 2 additions & 2 deletions charts/steadybit-agent/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: steadybit-agent
description: steadybit Agent Helm chart for Kubernetes.
version: 0.9.8
appVersion: latest
version: 1.0.0
appVersion: 1.0.108
home: https://www.steadybit.com/
icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png
maintainers:
Expand Down
2 changes: 1 addition & 1 deletion charts/steadybit-agent/templates/statefulset-mode-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
{{- end }}
containers:
- name: steadybit-agent
image: "{{ .Values.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
image: "{{ .Values.image.name }}:{{ default .Chart.AppVersion .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
requests:
Expand Down
4 changes: 2 additions & 2 deletions charts/steadybit-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ cluster:
image:
# image.name -- The container image to use of the steadybit agent.
name: steadybit/agent
# image.tag -- tag name of the agent container image to use.
tag: latest
# image.tag -- tag name of the agent container image to use. Defaults to appVersion of this chart.
tag: null
# image.pullPolicy -- Specifies when to pull the image container.
pullPolicy: Always
pullSecrets: []
Expand Down
4 changes: 2 additions & 2 deletions charts/steadybit-outpost/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: steadybit-outpost
description: steadybit outpost Helm chart for Kubernetes.
version: 1.1.55
appVersion: latest
version: 1.2.0
appVersion: 1.0.108
home: https://www.steadybit.com/
icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png
maintainers:
Expand Down
2 changes: 1 addition & 1 deletion charts/steadybit-outpost/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
{{- end }}
containers:
- name: steadybit-outpost
image: "{{ .Values.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
image: "{{ .Values.image.name }}:{{ default .Chart.AppVersion .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
requests:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ using oauth2 with mtls from containerPath and token uri:
name: RELEASE-NAME-steadybit-outpost
- name: STEADYBIT_AGENT_AUTH_OAUTH2_SERVER_CERT
value: /etc/ssl/certs/server.crt
image: steadybit/outpost:latest
image: steadybit/outpost:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down Expand Up @@ -222,7 +222,7 @@ using oauth2 with mtls from secrets:
name: some-secret
- name: STEADYBIT_AGENT_AUTH_OAUTH2_SERVER_CERT
value: /opt/steadybit/agent/etc/oauth2/server/tls.crt
image: steadybit/outpost:latest
image: steadybit/outpost:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ manifest should match snapshot:
value: "42899"
- name: STEADYBIT_AGENT_WORKING_DIR
value: /tmp/steadybit-outpost
image: steadybit/outpost:latest
image: steadybit/outpost:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down Expand Up @@ -227,7 +227,7 @@ should add aws account id from values:
value: /tmp/steadybit-outpost
- name: STEADYBIT_AGENT_AWS_ACCOUNT_ID
value: "123456789012"
image: steadybit/outpost:latest
image: steadybit/outpost:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down Expand Up @@ -381,7 +381,7 @@ should add match labels:
value: exclude-me-too
- name: STEADYBIT_AGENT_EXTENSIONS_AUTODISCOVERY_MATCHLABELSEXCLUDE_1_VALUE
value: true
image: steadybit/outpost:latest
image: steadybit/outpost:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down Expand Up @@ -520,7 +520,7 @@ should apply extra pod labels:
value: "42899"
- name: STEADYBIT_AGENT_WORKING_DIR
value: /tmp/steadybit-outpost
image: steadybit/outpost:latest
image: steadybit/outpost:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down Expand Up @@ -674,7 +674,7 @@ using extensions with mtls from containerpath:
value: strict
- name: STEADYBIT_AGENT_EXTRA_CERTS_PATH
value: /etc/ssl/extra-certs
image: steadybit/outpost:latest
image: steadybit/outpost:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down Expand Up @@ -823,7 +823,7 @@ using extensions with mtls from secrets:
name: some-secret
- name: STEADYBIT_AGENT_EXTENSIONS_SERVER_CERT
value: /opt/steadybit/agent/etc/extensions/server/tls.crt
image: steadybit/outpost:latest
image: steadybit/outpost:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down Expand Up @@ -972,7 +972,7 @@ using image pull secrets with debug json log:
value: "42899"
- name: STEADYBIT_AGENT_WORKING_DIR
value: /tmp/steadybit-outpost
image: steadybit/outpost:latest
image: steadybit/outpost:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down
9 changes: 3 additions & 6 deletions charts/steadybit-outpost/tests/statefulset_auth_test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
templates:
- statefulset.yaml
chart:
appVersion: 0.0.0
version: 0.0.0
tests:
- it: using oauth2 should require issuerUri or tokenUri
set:
Expand All @@ -10,8 +13,6 @@ tests:
provider: oauth2
oauth2:
clientId: some-client-id
chart:
version: 0.0.0
asserts:
- failedTemplate:
errorMessage: missing either .Values.outpost.auth.oauth2.issuerUri or .Values.outpost.auth.oauth2.tokenUri
Expand All @@ -35,8 +36,6 @@ tests:
value: some-oauth2-client-key-password
serverCertificate:
path: /etc/ssl/certs/server.crt
chart:
version: 0.0.0
asserts:
- matchSnapshot: { }

Expand Down Expand Up @@ -67,7 +66,5 @@ tests:
key: some-other-secret-key
serverCertificate:
fromSecret: server.crt
chart:
version: 0.0.0
asserts:
- matchSnapshot: { }
17 changes: 3 additions & 14 deletions charts/steadybit-outpost/tests/statefulset_test.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
templates:
- statefulset.yaml
- secrets.yaml
chart:
appVersion: 0.0.0
version: 0.0.0
tests:
- it: manifest should match snapshot
set:
global:
clusterName: test
outpost:
key: abcdefg
chart:
version: 0.0.0
asserts:
- matchSnapshot: { }

Expand All @@ -21,8 +22,6 @@ tests:
key: abcdefg
podLabels:
some-label: some-value
chart:
version: 0.0.0
asserts:
- matchSnapshot: { }

Expand All @@ -36,8 +35,6 @@ tests:
logging:
format: json
level: debug
chart:
version: 0.0.0
asserts:
- matchSnapshot: { }
- it: using extensions with mtls from containerpath
Expand All @@ -59,8 +56,6 @@ tests:
value: some-extension-client-key-password
serverCertificate:
path: /etc/ssl/certs/server.crt
chart:
version: 0.0.0
asserts:
- matchSnapshot: { }

Expand Down Expand Up @@ -88,8 +83,6 @@ tests:
key: some-secret-key
serverCertificate:
fromSecret: server.crt
chart:
version: 0.0.0
asserts:
- matchSnapshot: { }

Expand All @@ -99,8 +92,6 @@ tests:
key: abcdefg
aws:
accountId: "123456789012"
chart:
version: 0.0.0
asserts:
- matchSnapshot: { }

Expand All @@ -116,7 +107,5 @@ tests:
matchLabelsExclude:
exclude-me: true
exclude-me-too: true
chart:
version: 0.0.0
asserts:
- matchSnapshot: { }
4 changes: 2 additions & 2 deletions charts/steadybit-outpost/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ logging:
image:
# image.name -- The container image to use of the steadybit outpost.
name: steadybit/outpost
# image.tag -- tag name of the outpost container image to use.
tag: latest
# image.tag -- tag name of the outpost container image to use. Defaults to appVersion of this chart.
tag: null
# image.pullPolicy -- Specifies when to pull the image container.
pullPolicy: Always
pullSecrets: []
Expand Down
4 changes: 2 additions & 2 deletions charts/steadybit-platform/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: steadybit-platform
description: steadybit Platform Helm chart for Kubernetes.
version: 0.7.0
appVersion: latest
version: 1.0.0
appVersion: 1.0.100
home: https://www.steadybit.com/
icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png
maintainers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ manifest should support Recreate strategy:
- name: STEADYBIT_AUTH_STATIC_0_PASSWORD
value: '{noop}admin'
envFrom: []
image: docker.steadybit.io/steadybit/platform:latest
image: docker.steadybit.io/steadybit/platform:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down Expand Up @@ -185,7 +185,7 @@ manifest should support RollingUpdate strategy:
- name: STEADYBIT_AUTH_STATIC_0_PASSWORD
value: '{noop}admin'
envFrom: []
image: docker.steadybit.io/steadybit/platform:latest
image: docker.steadybit.io/steadybit/platform:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down Expand Up @@ -301,7 +301,7 @@ manifest should support extra certificate volume:
- name: STEADYBIT_AUTH_STATIC_0_PASSWORD
value: '{noop}admin'
envFrom: []
image: docker.steadybit.io/steadybit/platform:latest
image: docker.steadybit.io/steadybit/platform:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down Expand Up @@ -421,7 +421,7 @@ manifest should support extra volumes and mounts:
- name: STEADYBIT_AUTH_STATIC_0_PASSWORD
value: '{noop}admin'
envFrom: []
image: docker.steadybit.io/steadybit/platform:latest
image: docker.steadybit.io/steadybit/platform:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down Expand Up @@ -544,7 +544,7 @@ manifest should support init container:
- name: STEADYBIT_AUTH_STATIC_0_PASSWORD
value: '{noop}admin'
envFrom: []
image: docker.steadybit.io/steadybit/platform:latest
image: docker.steadybit.io/steadybit/platform:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down Expand Up @@ -626,7 +626,7 @@ manifest should support init container:
- name: STEADYBIT_AUTH_STATIC_0_PASSWORD
value: '{noop}admin'
envFrom: []
image: docker.steadybit.io/steadybit/platform:latest
image: docker.steadybit.io/steadybit/platform:0.0.0
imagePullPolicy: Always
name: steadybit-platform-db-migration
resources:
Expand Down Expand Up @@ -711,7 +711,7 @@ manifest should support various variables:
- name: STEADYBIT_AUTH_STATIC_0_PASSWORD
value: '{noop}admin'
envFrom: []
image: docker.steadybit.io/steadybit/platform:latest
image: docker.steadybit.io/steadybit/platform:0.0.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 5
Expand Down
3 changes: 3 additions & 0 deletions charts/steadybit-platform/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
templates:
- deployment.yaml
chart:
appVersion: 0.0.0
version: 0.0.0
tests:
- it: manifest should support Recreate strategy
chart:
Expand Down
Loading

0 comments on commit d42176e

Please sign in to comment.