diff --git a/.azure-devops/scraper-ci.yml b/.azure-devops/scraper-ci.yml index 331f01219..6f5b0b1c2 100644 --- a/.azure-devops/scraper-ci.yml +++ b/.azure-devops/scraper-ci.yml @@ -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