I am creating CICD pipeline in Azure Devops.
I have pipeline that has name set dynamically.
name: 'Set dynamically below in a task'
Then in BUILD stage I update it
[string] $date = (Get-Date -Format 'yyyyMMdd')
[string] $projectVersion = (Get-Content 'version.json') -join "`n" | ConvertFrom-Json | Select -ExpandProperty "version"
[string] $buildName = "$projectVersion.$(Build.BuildId)+$date.API"
Write-Host "##vso[build.updatebuildnumber]$buildName"
I have currently 3 stages
I am actually using ENVIRONMENT within Azure Devops to track all deployments and here is the problem. While pipeline build number is updated properly in Pipelines view
when I go to Environments tab the not so updated build name is being displayed.
How can I change that?
You can set between different environments, such as
FIRSTENVIRONMENT
echo "##vso[task.setvariable variable=VAR1;isOutput=true;]$VALUE";
SECONDENVIRONEMENT
- job: ‘JOBNAME’
variables:
var2: $[ dependencies.Build.outputs[Firstenvironment.VAR1] ]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.