下面的脚本是通过REST在Azure devops中触发管道,它在现有的管道上工作得很好,但当尝试从未运行过的新创建的管道时,它的抛出低于错误。任何帮助或建议都将不胜感激。
{"$id":"1","innerException":null,"message":"No pool was specified.\nUnexpected parameter 'pool'","typeName":"Microsoft.Azure.Pipelines.WebApi.PipelineValidationException, Microsoft.Azure.Pipelines.WebApi","typeKey":"PipelineValidationException","errorCode":0,"eventId":3000}
#!/bin/bash
echo "Enter PAT Token"
read -r PAT
echo "Enter Organization name"
read -r OrganizationName
echo "Enter Project ID"
read -r projectId
pipelineId=$(jq -r '.id' PipeOutput.txt) #Get definition ID from external TXT file
"Trigger_Pipeline=$(curl --write-out "%{http_code}\n" -X POST -L \
-u :"$PAT" "https://dev.azure.com/""${OrganizationName}""/""${projectId}""/_apis/pipelines/""${pipelineId}""/runs?api-version=6.0-preview.1" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"resources": {
"repositories": {
"self": {
"refName": "refs/heads/master"
}
}
}
}' --output Triggeroutput.txt --silent)"
echo "Output: $(Trigger_Pipeline)"
发布于 2021-05-17 16:24:34
我用新创建的经典管道和YAML管道测试了这个REST API,它在这两个管道上都工作得很好。
为了进一步调查这个问题,请分享新创建的管道定义的YAML文件。
此外,还请尝试以下步骤:
https://stackoverflow.com/questions/67565167
复制相似问题