I’m having difficulty importing a pipeline from another repository. I’ve checked it using the validator and it’s valid, but when I push to the development branch, no pipeline is triggered.
development
I need the pipeline to be triggered when I merge a pull request into the development branch, and the same goes for the production branch.
production
here's my shared pipeline
export: true
hi all.
based on bitbucket team, this config work on me.
repository shared-pipeline-config > bitbucket-pipeline.yml
export: truedefinitions: pipelines: share-pipeline-1: - step: &build-and-push name: Build and test image: docker:20.10.16 services: - docker caches: - docker script: - docker version
repository backend-service > bitbucket-pipeline.yml
pipelines: branches: development: import: shared-pipeline-config:main:share-pipeline-1 production: import: shared-pipeline-config:main:share-pipeline-1
Hi @Indra Rizky
The reason that it's not triggering on a branch push, is because you have defined the shared pipeline using the custom tag. This means the pipeline will only run when manually triggered (via the UI or API), not automatically on branch pushes or merges.
To trigger a pipeline automatically when you merge into development or production, you need to define the import under the branches section:
branches
pipelines:<br> branches: <br> development:<br> import: projectname/shared-pipeline-config:main:share-pipeline-1 <br> production: <br> import: projectname/shared-pipeline-config:main:share-pipeline-1
This will ensure the pipeline runs on any push (including merges) to those branches.
I hope this helps.
Cheers!
- Ben (Bitbucket Cloud Support)
hi @Ben , thanks for the answer
i already tried it, now pipeline was triggered but somehow the pipeline shows error
To investigate this further - we need access to your workspace, including your YAML configuration and build environment/build logs.
To do so - we will need you to raise a support ticket with our support team using your Premium workspace URL:
Please let me know if you encounter any issues raising a ticket, and I will raise one on your behalf.
hi @Benyes thank you, i dont mind if you help me create ticket for this issue
It looks like you're new here. Sign in or register to get started.