Hello Team Bitbucket, I would like to ask, is it possible to trigger a shared bitbucket pipeline more than one?
let say i have bitbucket-pipeline.yaml in shared-repo-config
definitions:
pipelines:
share-pipeline-code-checker:
- step:
script: npm run test
shared-pipeline-build:
- step:
script: docker build
i want to trigger share-pipeline-code-checker only when pr is create, and trigger share-pipeline-code-checker and shared-pipeline-build when pr is merge.
i've done create bitbucket-pipeline.yaml in main-repo like this and doesnt work
pipelines:
pull-requests:
'**':
import: shared-pipeline-config:main:share-pipeline-code-checker
branches:
development:
import:
- shared-pipeline-config:main:share-pipeline-code-checker
- shared-pipeline-config:main:share-pipeline-build
or something like this, doesnt work either
pipelines:
pull-requests:
'**':
- import: shared-pipeline-config:main:share-pipeline-code-checker
branches:
development:
import: shared-pipeline-config:main:share-pipeline-code-checker
import: shared-pipeline-config:main:share-pipeline-build
Because I believe there would be a lot of repetition if I could only trigger one shared pipeline. Based on my example above, I would also have to create the share-pipeline-code-checker step inside the share-pipeline-build, which is not effective. Or, is this possible? can we request feature like this in bitbucket pipeline ?
Hey @Indra Rizky
Currently, Bitbucket Pipelines does not support triggering multiple shared pipelines in a single trigger (like a PR or branch event) you can only import one shared pipeline per trigger.
To avoid duplicating steps, it is best practice to define reusable steps in your shared configuration and create composite pipelines that combine these steps as needed. Then, import the appropriate single pipeline for each trigger in your main repository.
Regards,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.