问题描述
我在Azure Devops中有一个发布管道。在发布管道中,我有一个bash脚本-step,它引用变量 $(Release.Artifacts.MyCustomAlias.BuildNumber)。在脚本中,我回显了变量的值。
现在,我创建了一个新版本,并选择了构建 20200820.22 作为工件。
检查脚本的输出时,它使用的是值 20200821.2 ,它是最新版本,而不是我选择的版本。
如何从发行脚本访问正确的构建版本?
解决方法
我试图重蹈覆辙。
对于此脚本:
import { Component,OnInit,Input } from "@angular/core";
@Component({
selector: "app-app-control-message",templateUrl: "./app-control-message.component.html",styleUrls: ["./app-control-message.component.css"]
})
export class AppControlMessageComponent implements OnInit {
@Input() control; // Input whose value parent component will provide
constructor() {}
ngOnInit() {}
}
我得到正确的结果:
由于最新的版本是Write-Host $(Build.BuildNumber)
Write-Host $(Release.Artifacts.CustomName.BuildNumber)
,因此它将选择正确的编号。请尝试适用于主要工件的20200821.1
。