From 10b0f257618eeb85d7aa823ad63980550994afc1 Mon Sep 17 00:00:00 2001 From: davidpoltorak-io <109518299+davidpoltorak-io@users.noreply.github.com> Date: Thu, 27 Jul 2023 12:16:33 +0100 Subject: [PATCH] feat: helm-chart appVersion bump and addtional fixes (#67) * fix: add string secret for consumers to allow keys to be generated * fix: set service endpoint to applicationUrls without mediator suffix * fix: restore cors configuration to mediation route * ci: add helm-chart appVersion bump to release process * ci: install yq to be used in release process * chore: remove empty line Signed-off-by: David Poltorak Signed-off-by: davidpoltorak-io <109518299+davidpoltorak-io@users.noreply.github.com> --- .github/workflows/release.yml | 2 ++ .../mediator/templates/apisixroute.yaml | 1 + .../charts/mediator/templates/deployment.yaml | 2 +- .../mediator/templates/stringsecret.yaml | 20 +++++++++++++++++++ package.json | 9 ++++++++- 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 infrastructure/charts/mediator/templates/stringsecret.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb82633c..0688a883 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,6 +38,8 @@ jobs: uses: actions/setup-node@v3 with: node-version: "lts/*" + - name: Setup yq - portable yaml processor + uses: mikefarah/yq@v4.34.2 - name: Setup Scala.JS uses: japgolly/setup-scalajs@v1 - name: Cache sbt diff --git a/infrastructure/charts/mediator/templates/apisixroute.yaml b/infrastructure/charts/mediator/templates/apisixroute.yaml index 0985f987..7c267d66 100644 --- a/infrastructure/charts/mediator/templates/apisixroute.yaml +++ b/infrastructure/charts/mediator/templates/apisixroute.yaml @@ -24,6 +24,7 @@ spec: enable: true config: regex_uri: ["^/(.*)","/$1"] + {{ template "cors" . }} --- diff --git a/infrastructure/charts/mediator/templates/deployment.yaml b/infrastructure/charts/mediator/templates/deployment.yaml index c139df3e..f9e4e59c 100644 --- a/infrastructure/charts/mediator/templates/deployment.yaml +++ b/infrastructure/charts/mediator/templates/deployment.yaml @@ -40,4 +40,4 @@ spec: - name: MONGODB_DB_NAME value: "mediator" - name: SERVICE_ENDPOINT - value: "https://{{ index .Values.ingress.applicationUrls 0 }}/mediator" + value: "https://{{ index .Values.ingress.applicationUrls 0 }}" diff --git a/infrastructure/charts/mediator/templates/stringsecret.yaml b/infrastructure/charts/mediator/templates/stringsecret.yaml new file mode 100644 index 00000000..46124886 --- /dev/null +++ b/infrastructure/charts/mediator/templates/stringsecret.yaml @@ -0,0 +1,20 @@ +{{- if .Values.ingress.enabled }} +{{- $root := . -}} +{{- range $consumer := .Values.ingress.consumers }} +apiVersion: "secretgenerator.mittwald.de/v1alpha1" +kind: StringSecret +metadata: + name: "{{ $root.Release.Namespace }}-{{ $consumer | lower }}" + namespace: {{ $root.Release.Namespace }} + labels: + {{ template "labels.common" . }} +spec: + forceRegenerate: false + data: + username: {{ $consumer | lower }} + fields: + - fieldName: "key" + encoding: "base64" + length: "32" +{{- end }} +{{- end }} diff --git a/package.json b/package.json index ec43317a..2ce122d3 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,12 @@ "prepareCmd": "NODE_OPTIONS=--openssl-legacy-provider sbt -mem 2048 -J-Xmx5120m \"release release-version ${nextRelease.version} next-version ${nextRelease.version}-SNAPSHOT with-defaults\"" } ], + [ + "@semantic-release/exec", + { + "prepareCmd": "yq -i '.appVersion = \"${nextRelease.version}\"' ./infrastructure/charts/mediator/Chart.yaml" + } + ], [ "@semantic-release/exec", { @@ -63,7 +69,8 @@ "version.sbt", "CHANGELOG.md", "package.json", - "package-lock.json" + "package-lock.json", + "infrastructure/charts/mediator/Chart.yaml" ], "message": "chore(release): cut prism mediator ${nextRelease.version} release\n\n${nextRelease.notes}" }