From c9031d3ef2e9f85f4a894a32d3d28b8c77d93cd8 Mon Sep 17 00:00:00 2001 From: Ayoola Makinde Date: Wed, 20 Mar 2024 15:03:01 +0100 Subject: [PATCH 1/2] Add identifier conditional --- .github/workflows/deploy-to-k8s.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-to-k8s.yml b/.github/workflows/deploy-to-k8s.yml index 509e76d..28ea6d1 100644 --- a/.github/workflows/deploy-to-k8s.yml +++ b/.github/workflows/deploy-to-k8s.yml @@ -84,7 +84,19 @@ jobs: echo "NAMESPACE=$NAMESPACE" >> $GITHUB_ENV - helm template . -f ./values.yaml -f ./values-$APP_ENV.yaml --set imageTag=$IMAGE_TAG-$CI_SHA_SHORT --set replicas=$REPLICAS > ${{ runner.temp }}/manifest.yaml + if [ -n ${{ github.event.inputs.identifier }}]; then + helm template . -f ./values.yaml \ + --set imageTag=$IMAGE_TAG-$CI_SHA_SHORT \ + --set replicas=$REPLICAS \ + --set identifier=${{ github.event.inputs.identifier }} \ + > ${{ runner.temp }}/manifest.yaml + else + helm template . -f ./values.yaml -f ./values-$APP_ENV.yaml \ + --set imageTag=$IMAGE_TAG-$CI_SHA_SHORT \ + --set replicas=$REPLICAS \ + > ${{ runner.temp }}/manifest.yaml + fi + ls ${{ runner.temp }} echo "Done: Generated manifest!" From f7f016cc8ee38c06b5558b23a12d83eed4a57227 Mon Sep 17 00:00:00 2001 From: Ayoola Makinde Date: Wed, 20 Mar 2024 15:23:52 +0100 Subject: [PATCH 2/2] Add some logging --- .github/workflows/deploy-to-k8s.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-to-k8s.yml b/.github/workflows/deploy-to-k8s.yml index 28ea6d1..f038f64 100644 --- a/.github/workflows/deploy-to-k8s.yml +++ b/.github/workflows/deploy-to-k8s.yml @@ -84,13 +84,17 @@ jobs: echo "NAMESPACE=$NAMESPACE" >> $GITHUB_ENV - if [ -n ${{ github.event.inputs.identifier }}]; then + echo " identifier: ${{ github.event.inputs.identifier }}" + + if [ -n ${{ github.event.inputs.identifier }} ]; then + echo ">> Using identifier" helm template . -f ./values.yaml \ --set imageTag=$IMAGE_TAG-$CI_SHA_SHORT \ --set replicas=$REPLICAS \ --set identifier=${{ github.event.inputs.identifier }} \ > ${{ runner.temp }}/manifest.yaml else + echo ">> Not using identifier" helm template . -f ./values.yaml -f ./values-$APP_ENV.yaml \ --set imageTag=$IMAGE_TAG-$CI_SHA_SHORT \ --set replicas=$REPLICAS \