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 :
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
Thank you for reaching out to the community.
I'm afraid it's not possible for you to run multiple patterns for your custom steps in your Pipelines YAML configuration as the API only works for a single trigger.
If you want to trigger the other custom steps, you will have to run multiple Curl commands with different patterns.
Let me know if you have any further questions.
Regards,
Mark C
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.