Skip to content

Commit

Permalink
Seperate Helm argument
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwatson484 committed Nov 17, 2022
1 parent 83c9587 commit 44e6ad0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.5
1.6.6
19 changes: 13 additions & 6 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ variables:
value:
- name: helmRepository
value: services.lynxmagnus.com:8080
- name: helmFileArg
value:

jobs:
- job: Build
Expand Down Expand Up @@ -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))

0 comments on commit 44e6ad0

Please sign in to comment.