Skip to content

Commit

Permalink
Make sure to use the correct image version in CI Helm Chart (#623)
Browse files Browse the repository at this point in the history
* Make sure to use the correct image version

* Use correct variable approach

* Let try this

Signed-off-by: Tom Kerkhove <[email protected]>
  • Loading branch information
tomkerkhove authored Jul 19, 2019
1 parent 7aabdbe commit 6e25e59
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .azure-devops/scraper-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,19 @@ stages:
echo 'Copying Chart folder'
cp promitor-agent-scraper/ $(Helm.Chart.Name)/ -r
echo 'Determining image version'
$imageVersion = "$(Build.BuildNumber)".ToLower()
$replacedTagSection = " tag: $imageVersion"
echo 'Image version is $imageVersion'
echo 'Changing name of chart'
((Get-Content -path $(Helm.Chart.Name)/Chart.yaml -Raw) -replace 'name: promitor-agent-scraper','name: $(Helm.Chart.Name)') | Set-Content -Path $(Helm.Chart.Name)/Chart.yaml
((Get-Content -path $(Helm.Chart.Name)/Chart.yaml -Raw) -replace 'name: promitor-agent-scraper', 'name: $(Helm.Chart.Name)') | Set-Content -Path $(Helm.Chart.Name)/Chart.yaml
echo 'Changing image tag'
((Get-Content -path $(Helm.Chart.Name)/values.yaml -Raw) -replace ' tag: 1.0.0-preview-8',' tag: $(Build.BuildNumber)') | Set-Content -Path $(Helm.Chart.Name)/values.yaml
((Get-Content -path $(Helm.Chart.Name)/values.yaml -Raw) -replace ' tag: 1.0.0-preview-8', $replacedTagSection) | Set-Content -Path $(Helm.Chart.Name)/values.yaml
echo 'Changing repo name'
((Get-Content -path $(Helm.Chart.Name)/values.yaml -Raw) -replace ' repository: tomkerkhove/promitor-agent-scraper',' repository: $(Image.Name)') | Set-Content -Path $(Helm.Chart.Name)/values.yaml
((Get-Content -path $(Helm.Chart.Name)/values.yaml -Raw) -replace ' repository: tomkerkhove/promitor-agent-scraper', ' repository: $(Image.Name)') | Set-Content -Path $(Helm.Chart.Name)/values.yaml
echo 'Change name of chart in documentation samples'
((Get-Content -path $(Helm.Chart.Name)/README.md -Raw) -replace 'promitor-agent-scraper','promitor-agent-scraper-ci') | Set-Content -Path $(Helm.Chart.Name)/README.md
Expand Down

0 comments on commit 6e25e59

Please sign in to comment.