问题描述
我想通过自定义 BitBucket API 调用自定义 bitbucket 管道。有没有办法可以在下面调用 API 的命令中传递多个模式?
目前,我只能通过命令行(Bit bucket API)运行一个管道 create-aws-account。
注意:我想通过自定义的 bitbucket API 命令运行下面提到的 yaml 文件:
create-aws-account 设置sso权限 运行-cloudhealth-pipeline 运行-tekton-管道
命令:
curl -X POST -is -u uname:password \
-H 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/xxxx/xxxx/pipelines/ \
-d '
{
"target": {
"type": "pipeline_ref_target","ref_type": "branch","ref_name": "master","selector": {
"type": "custom","pattern": "create-aws-account"
}
},"variables": [
{
"key": "account_id","value": "02020202","secured": true
},
下面是我的流水线代码 bitbucket-pipelines.yml,我想一个接一个地依次运行它们。
pipelines:
custom:
create-aws-account:
- variables:
- name: account_id # single string (required)
- step: *tfapply
set-sso-permissions:
- variables:
- name: aws_account_id # single string (required)
- name: aws_region # us-east-1 or ca-central-1
- step: *aws_sso_access
run-cloudhealth-pipeline:
- variables:
- name: aws_account_name
- name: aws_account_id
- step: *cloudhealth_pipeline
run-tekton-pipeline:
- variables:
- name: account_id # single string (required)
- name: app_id # single string (optional)
- step: *tekton_pipeline
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)