diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b0f558ac2b0c2deafe673d8bd2cf32c8ea14467..3e7cee4488d7b077622aa5705c7e506ffd2d9378 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -64,7 +64,7 @@ deploy production: script: - cd deploy/overlays/production - kustomize edit set image registry.edugit.org/teckids/team-pr/teckids.org:$CI_COMMIT_REF_NAME@$(cat ../../../DIGESTFILE) - - kustomize build | envsubst > output.yaml + - kustomize build > output.yaml - kubectl --kubeconfig=/tmp/kubeconfig apply -f output.yaml only: - master @@ -83,7 +83,7 @@ deploy review: script: - cd deploy/overlays/review - kustomize edit set image registry.edugit.org/teckids/team-pr/teckids.org:$CI_COMMIT_REF_NAME@$(cat ../../../DIGESTFILE) - - kustomize build | envsubst > output.yaml + - kustomize build | sed s/__REVIEW_NAME__/$CI_COMMIT_REF_SLUG/g > output.yaml - kubectl --kubeconfig=/tmp/kubeconfig apply -f output.yaml delete review: diff --git a/deploy/overlays/review/kustomization.yaml b/deploy/overlays/review/kustomization.yaml index 5ee2add9785bfd592f8ff4f67e786ace712b1487..58a8bcb99f359f35da1012f2faa9c3cc6a1b15c5 100644 --- a/deploy/overlays/review/kustomization.yaml +++ b/deploy/overlays/review/kustomization.yaml @@ -6,7 +6,7 @@ commonAnnotations: source-repository: https://edugit.org/Teckids/team-pr/teckids.org commonLabels: app: teckids-website - environment: ${CI_COMMIT_REF_SLUG} + environment: __REVIEW_NAME__ namespace: teckids-website patches: - target: @@ -15,7 +15,10 @@ patches: patch: |- - op: replace path: /spec/rules/0/host - value: ${CI_COMMIT_REF_SLUG}.review.teckids.org + value: __REVIEW_NAME__.review.teckids.org - op: replace path: /spec/tls/0/hosts/0 - value: ${CI_COMMIT_REF_SLUG}.review.teckids.org + value: __REVIEW_NAME__.review.teckids.org + - op: replace + path: /spec/tls/0/secretName + value: __REVIEW_NAME__-website-tls