I want to invoke a custom bitbucket pipeline via custom BitBucket API. Is there a way I can pass multiple patterns in the below command calling the API ?
At present, I am able to run only one pipeline create-aws-account via the command line (Bit bucket API).
Note: I want to run the yaml file mentioned in below sequence via the custom bitbucket API command :
- create-aws-account
- set-sso-permissions
- run-cloudhealth-pipeline
- run-tekton-pipeline
Command:
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
},
Below is my Pipeline code bitbucket-pipelines.yml and I want to run them sequentially one after the other.
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