diff --git a/.github/workflows/bump-chart-version.yml b/.github/workflows/bump-chart-version.yml new file mode 100644 index 00000000..c2b5f9b8 --- /dev/null +++ b/.github/workflows/bump-chart-version.yml @@ -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 "$GITHUB_ACTOR@users.noreply.github.com" + git commit -am "chore: update helm chart version" + git push \ No newline at end of file diff --git a/Makefile b/Makefile index 6d3ef2e2..cb3c1030 100755 --- a/Makefile +++ b/Makefile @@ -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; \ \ No newline at end of file diff --git a/charts/steadybit-agent/Chart.yaml b/charts/steadybit-agent/Chart.yaml index 34d2faad..6665fc70 100644 --- a/charts/steadybit-agent/Chart.yaml +++ b/charts/steadybit-agent/Chart.yaml @@ -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: diff --git a/charts/steadybit-agent/templates/statefulset-mode-aws.yaml b/charts/steadybit-agent/templates/statefulset-mode-aws.yaml index fef43bdd..9f829461 100644 --- a/charts/steadybit-agent/templates/statefulset-mode-aws.yaml +++ b/charts/steadybit-agent/templates/statefulset-mode-aws.yaml @@ -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: diff --git a/charts/steadybit-agent/values.yaml b/charts/steadybit-agent/values.yaml index c402c3ac..1667e049 100644 --- a/charts/steadybit-agent/values.yaml +++ b/charts/steadybit-agent/values.yaml @@ -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: [] diff --git a/charts/steadybit-outpost/Chart.yaml b/charts/steadybit-outpost/Chart.yaml index bbb4db19..68e993ce 100644 --- a/charts/steadybit-outpost/Chart.yaml +++ b/charts/steadybit-outpost/Chart.yaml @@ -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: diff --git a/charts/steadybit-outpost/templates/statefulset.yaml b/charts/steadybit-outpost/templates/statefulset.yaml index ccc675da..3759b818 100644 --- a/charts/steadybit-outpost/templates/statefulset.yaml +++ b/charts/steadybit-outpost/templates/statefulset.yaml @@ -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: diff --git a/charts/steadybit-outpost/tests/__snapshot__/statefulset_auth_test.yaml.snap b/charts/steadybit-outpost/tests/__snapshot__/statefulset_auth_test.yaml.snap index da380e9d..b5ffc084 100644 --- a/charts/steadybit-outpost/tests/__snapshot__/statefulset_auth_test.yaml.snap +++ b/charts/steadybit-outpost/tests/__snapshot__/statefulset_auth_test.yaml.snap @@ -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 @@ -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 diff --git a/charts/steadybit-outpost/tests/__snapshot__/statefulset_test.yaml.snap b/charts/steadybit-outpost/tests/__snapshot__/statefulset_test.yaml.snap index 10d4567e..9a38cdab 100644 --- a/charts/steadybit-outpost/tests/__snapshot__/statefulset_test.yaml.snap +++ b/charts/steadybit-outpost/tests/__snapshot__/statefulset_test.yaml.snap @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/charts/steadybit-outpost/tests/statefulset_auth_test.yaml b/charts/steadybit-outpost/tests/statefulset_auth_test.yaml index 72f01873..f11253ab 100644 --- a/charts/steadybit-outpost/tests/statefulset_auth_test.yaml +++ b/charts/steadybit-outpost/tests/statefulset_auth_test.yaml @@ -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: @@ -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 @@ -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: { } @@ -67,7 +66,5 @@ tests: key: some-other-secret-key serverCertificate: fromSecret: server.crt - chart: - version: 0.0.0 asserts: - matchSnapshot: { } diff --git a/charts/steadybit-outpost/tests/statefulset_test.yaml b/charts/steadybit-outpost/tests/statefulset_test.yaml index 105f45ad..9ac6ca40 100644 --- a/charts/steadybit-outpost/tests/statefulset_test.yaml +++ b/charts/steadybit-outpost/tests/statefulset_test.yaml @@ -1,6 +1,9 @@ templates: - statefulset.yaml - secrets.yaml +chart: + appVersion: 0.0.0 + version: 0.0.0 tests: - it: manifest should match snapshot set: @@ -8,8 +11,6 @@ tests: clusterName: test outpost: key: abcdefg - chart: - version: 0.0.0 asserts: - matchSnapshot: { } @@ -21,8 +22,6 @@ tests: key: abcdefg podLabels: some-label: some-value - chart: - version: 0.0.0 asserts: - matchSnapshot: { } @@ -36,8 +35,6 @@ tests: logging: format: json level: debug - chart: - version: 0.0.0 asserts: - matchSnapshot: { } - it: using extensions with mtls from containerpath @@ -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: { } @@ -88,8 +83,6 @@ tests: key: some-secret-key serverCertificate: fromSecret: server.crt - chart: - version: 0.0.0 asserts: - matchSnapshot: { } @@ -99,8 +92,6 @@ tests: key: abcdefg aws: accountId: "123456789012" - chart: - version: 0.0.0 asserts: - matchSnapshot: { } @@ -116,7 +107,5 @@ tests: matchLabelsExclude: exclude-me: true exclude-me-too: true - chart: - version: 0.0.0 asserts: - matchSnapshot: { } \ No newline at end of file diff --git a/charts/steadybit-outpost/values.yaml b/charts/steadybit-outpost/values.yaml index 2e6e64dd..fc2c631a 100644 --- a/charts/steadybit-outpost/values.yaml +++ b/charts/steadybit-outpost/values.yaml @@ -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: [] diff --git a/charts/steadybit-platform/Chart.yaml b/charts/steadybit-platform/Chart.yaml index 106e330c..029ddf4d 100644 --- a/charts/steadybit-platform/Chart.yaml +++ b/charts/steadybit-platform/Chart.yaml @@ -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: diff --git a/charts/steadybit-platform/tests/__snapshot__/deployment_test.yaml.snap b/charts/steadybit-platform/tests/__snapshot__/deployment_test.yaml.snap index 089b194f..ee34fc39 100644 --- a/charts/steadybit-platform/tests/__snapshot__/deployment_test.yaml.snap +++ b/charts/steadybit-platform/tests/__snapshot__/deployment_test.yaml.snap @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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: @@ -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 diff --git a/charts/steadybit-platform/tests/deployment_test.yaml b/charts/steadybit-platform/tests/deployment_test.yaml index eefa1bce..0fca10f3 100644 --- a/charts/steadybit-platform/tests/deployment_test.yaml +++ b/charts/steadybit-platform/tests/deployment_test.yaml @@ -1,5 +1,8 @@ templates: - deployment.yaml +chart: + appVersion: 0.0.0 + version: 0.0.0 tests: - it: manifest should support Recreate strategy chart: diff --git a/charts/steadybit-platform/values.yaml b/charts/steadybit-platform/values.yaml index a0fa4b0e..a78d5def 100644 --- a/charts/steadybit-platform/values.yaml +++ b/charts/steadybit-platform/values.yaml @@ -103,7 +103,7 @@ image: # image.name -- The container image to use of the steadybit platform. name: docker.steadybit.io/steadybit/platform # image.tag -- Tag name of the platform container image to use. - tag: latest + tag: null # image.pullPolicy -- Specifies when to pull the image container. pullPolicy: Always registry: {}