Bitbucket Pipeline Shared Configuration not running on dependent repository
Asked by chekju:

Hello community.

I am new to Bitbucket Pipeline Shared Configuration .

<https://support.atlassian.com/bitbucket-cloud/docs/share-pipelines-configurations/>

I have two repos in the same Bitbucket Repository workspace project.

repo1 named : harmony-helm-chart, has the bitbicket-pipeline.yml. The repo built successfully.

"  
export: true  

image: stackrox/kube-linter:main-alpine

definitions:  
pipelines:  
share-pipeline-lint: \&share-pipeline-lint  
- step:  
name: Kube-Linter Lint  
script:  
- /kube-linter lint . --config ci/kube-linter-config.yaml

<br />

pipelines:  
custom:  
manifest-share-pipeline: \*share-pipeline-lint

<br />

"

the second repo2 is referencing the "share-pipeline-lint"

as in

""  
pipelines:  
custom:  
import-pipeline:  
import: harmony-helm-chart:kube-linter:share-pipeline-lint  
""

repo2 is referencing harmony-helm-chart but not building.

I had been debugging the failed pipeline. Could need some help.


Answers:
author: Theodora Boudale
body: Hi [@chekju](/t5/user/viewprofilepage/user-id/5331460) and welcome to the community!  

* What error do you see when you try to run a build on repo2?  

* Do these repos belong to a workspace on the Premium plan?  

* In the yml file of repo2, I see  

  ```
  import: harmony-helm-chart:kube-linter:share-pipeline-lint
  ```

  <br />

  Does the branch **kube-linter** exist in the repo **harmony-helm-chart** ? If so, is there a definition for **share-pipeline-lint** in the yml file of this branch?

Kind regards,  
Theodora

comments: author: chekju
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)

Thanks for the response

The error on repo2 is this this, Repo2 is not building at all, I have this Bitbucket-pipeline.yml inside the repo as in

""  
pipelines:  
custom:  
import-pipeline:  
import: harmony-helm-chart:kube-linter:share-pipeline-lint

""

but the pipeline does not build.

I am on a Premium plan and both repo1 and repo2 are in the same workspace.

<br />

For the repo1 named : harmony-helm-chart, kube-linter does exist and there is definition in the yml file as seen in the yml file

<br />

""  
export: true

image: stackrox/kube-linter:main-alpine

definitions:  
pipelines:  
share-pipeline-lint: \&share-pipeline-lint  
- step:  
name: Kube-Linter Lint  
script:  
- /kube-linter lint . --config ci/kube-linter-config.yaml

pipelines:  
custom:  
manifest-share-pipeline: \*share-pipeline-lint

<br />

""

in line 5 there is a defined definition called "share-pipeline-lint"


author: Theodora Boudale
body: Hi [@chekju](/t5/user/viewprofilepage/user-id/5331460),

It is not clear from your reply if the definition exists in the ++branch named kube-linter++ in repo1. The yml file may have different versions across different branches.

If you open the **Source** page of **repo1** in Bitbucket Cloud, there is a dropdown to switch branches right above the file list. Click on that dropdown, select the branch **kube-linter,** and then inspect the yml file in that branch. Is the definition there?

Is Pipelines enabled in repo2? You can check that from **Repository settings \>** section**PIPELINES, Settings**.

If the answer to the questions I asked is yes, I would suggest creating a ticket with the support team and sharing the URL of the two repos, so we can check your config and investigate.

You can create a ticket via <https://support.atlassian.com/contact/#/>, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. When you are asked to provide the workspace URL, please make sure you enter the URL of the workspace that is on the premium plan to proceed with ticket creation.

Please feel free to let me know if you have any questions.

Kind regards,  
Theodora


author: chekju
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) how do I set up definition in the ++branch named kube-linter++ in repo1.

Pipelines is enabled in repo2 from the **Repository settings \>** section**PIPELINES, Settings, but I do need help in setting up definition n the ++branch named kube-linter++**


author: Theodora Boudale
body: Hi [@chekju](/t5/user/viewprofilepage/user-id/5331460),

If you don't have a branch named kube-linter in repo1 already, it is not necessary to set it up.

You will just need to change the definition in repo2, and replace kube-linter with the name of the branch in repo1 where the yml definition exists.

For example, if the shared pipeline is defined in repo1, in the yml file of master branch, then in repo2 you define the pipeline as follows:

```
pipelines:
  custom:
    import-pipeline:
      import: harmony-helm-chart:master:share-pipeline-lint
```

The part after harmony-helm-chart should be the name of the branch in harmony-helm-chart repo, that has the yml with the exported pipeline.

Otherwise, if there is a branch named kube-linter in repo1, you simply edit the yml file in that branch and add the definition that exports the pipeline.

Does this help?

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud