siteToDeploy
和
siteToStop
. 我正在使用postman对IIS管理API运行测试脚本。在其中一个请求的测试部分,我试图设置azure devops输出变量。这是一种工作方式,但由于某种原因,变量值被切断了。
log(pm.globals.get(“siteName”))
var response = pm.response.json();
var startedSite = _.find(response.websites, function(o) { return o.name.indexOf(pm.globals.get("siteName")) > -1 && pm.globals.get("siteName") && o.status == 'started'});
var stoppedSite = _.find(response.websites, function(o) { return o.name.indexOf(pm.globals.get("siteName")) > -1 && o.status == 'stopped'});
if(stoppedSite && startedSite){
console.log('sites found');
console.log(stoppedSite.id)
console.log('##vso[task.setvariable variable=siteToDeploy;]' + stoppedSite.id);
console.log('##vso[task.setvariable variable=siteToStop;]' + startedSite.id);
}
下面是一个命令行任务的输出,它回显$(siteToDeploy)变量。它正在设置,但不是整个值。
我试过逃避,但没有效果。我还创建了一个静态命令行echo,其中设置了变量,效果很好。因此,我不确定这是纽曼问题还是Azure在获取变量时遇到问题。