bitbucket-pipelines - 通过带有参数的 API 调用 Bitbucket 管道
问题描述
我有一个将从外部触发的 bitbucket 管道:
custom:
# This Pipeline will be triggered automatically when the setup succeeds
test-deployment:
- variables:
- name: build_number
- step:
name: "Test"
image: atlassian/default-image:latest
script:
- echo $build_number
- export
我必须将参数“build_number”传递给这个管道,我通过以下调用尝试了这个:
curl -X POST -is -u user:pass \
-H 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/user/repo/pipelines/ \
-d '
{
"target": {
"ref_type": "branch",
"type": "pipeline_ref_target",
"ref_name": "feature/pipeline-tests",
"selector": {
"type": "custom",
"pattern" : "test-deployment"
}
}
},
"variables": [
{
"key" : "build_number",
"value" : "202"
}
]
}'
但是没有设置“build_number”。如果我通过 Bitbucket UI 调用管道,它可以工作。这里有什么问题?
解决方案
推荐阅读
- javascript - 猫头鹰旋转木马的背景图像不起作用
- c# - 删除旧关系并在 c# 上的同一查询中创建具有相同标签的新关系,使用 cypher for neo4j DB
- java - 在 Google 日历上更新事件会自动将 EventAtendee 设置为 self
- wpf - 如何在 Prism WPF 应用程序中实现 Serilog?
- python-3.x - SyntaxError: 第 1 行文件 .\score_python.exe 中以 '\x90' 开头的非 UTF-8 代码,但未声明编码;
- swift - 在手动导入的 SDK 中导入 Alamofire
- amazon-web-services - 如何在 Amazon Lex 中使用单个话语调用多个意图?
- xml - 通过 XML 和 XSL(i18n 上下文)生成 HTML 页面的问题
- javascript - pdfkit - 不以编程方式填充“按钮”类型
- highcharts - 大数据点的热图图表未正确显示