From 44e6ad06407e3ef0eb35035c7787efc334a14f3d Mon Sep 17 00:00:00 2001 From: John Watson Date: Thu, 17 Nov 2022 19:29:59 +0000 Subject: [PATCH] Seperate Helm argument --- VERSION | 2 +- build.yaml | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 9f05f9f..ec70f75 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.5 +1.6.6 diff --git a/build.yaml b/build.yaml index afb7ff4..0b81413 100644 --- a/build.yaml +++ b/build.yaml @@ -51,6 +51,8 @@ variables: value: - name: helmRepository value: services.lynxmagnus.com:8080 + - name: helmFileArg + value: jobs: - job: Build @@ -278,17 +280,22 @@ jobs: targetFolder: /tmp condition: and(succeeded(), eq(${{ parameters.deploy }}, true)) + - task: Bash@3 + displayName: Set Helm file argument + inputs: + targetType: 'inline' + script: | + helmFileArg="-f /tmp/${{ parameters.name }}-values.yaml" + echo "##vso[task.setvariable variable=helmFileArg;]$helmFileArg" + condition: and(succeeded(), eq(${{ parameters.deploy }}, true), eq(${{ parameters.hasSecureHelmValuesFile }}, true)) + - task: SSH@0 displayName: 'Deploy to Kubernetes' inputs: sshEndpoint: 'Kubernetes Master' runOptions: inline - inline: | - fileArg="" - if [ "${${{ parameters.hasSecureHelmValuesFile }}}" = "true" ]; then - fileArg="-f /tmp/${{ parameters.name }}-values.yaml" - fi + inline: | helm repo update - helm upgrade --install --namespace ${{ parameters.namespace }} -f /tmp/${{ parameters.name }}-values.yaml $(repo) --atomic lynxmagnus/$(repo) --version $(version) --create-namespace + helm upgrade --install --namespace ${{ parameters.namespace }} $(helmFileArg) $(repo) --atomic lynxmagnus/$(repo) --version $(version) --create-namespace rm -rf /tmp/${{ parameters.name }}-values.yaml condition: and(succeeded(), eq(${{ parameters.deploy }}, true))