Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Shared pipelines

Andrew McMorris October 5, 2023

Are there any working examples of Shared pipelines as the one here does not work.

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

 

I am getting this error:

There is an error in the imported bitbucket-pipelines.yml file. The error is at [line 3, column 12]. Mapping values are not allowed here

On shared:

 

export:true

definitions:
  pipelines:
    hello-world:
      - step:
          name: "hello world"
          script:
            - echo hello

4 answers

2 accepted

2 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 6, 2023

Hi Andrew,

I believe the error occurs because there is no space between export: and true.

Could you please adjust it like below and let us know if the pipeline runs then?

export: true

I will reach out to the documentation team to fix the example.

Kind regards,
Theodora

Aron Gombas _Midori_
Community Champion
October 6, 2023

@Theodora Boudale I also notice that, but please have a look at the official example! There is no extra space in that example, either. If this is the solution, then the doc should be updated, too.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 6, 2023

Hi Aron,

Yes, I saw that the official example is incorrect, which is why I said I would reach out to the documentation team to fix it. :)

Kind regards,
Theodora

Like Aron Gombas _Midori_ likes this
1 vote
Answer accepted
Andrew McMorris October 6, 2023

Thanks both that got me further. I am now struggling to work out how to have import and steps working beside each other. where I am importing to is below:

 

  default:
    import: shared-pipeline:main:hello-world
    - step: *software_versions
But does not like me mixing the two beside each other, any ideas of what to do?
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 10, 2023

Hi Andrew,

What you are trying to do is not possible, you cannot have an imported pipeline with additional steps.

Kind regards,
Theodora

Andrew McMorris October 10, 2023

Thanks Theodora, I raised with support and got the same answer. Makes this very limited and a all or nothing type solution, great start though and looking forward to seeing improvments.

Like Theodora Boudale likes this
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 11, 2023

You are welcome, Andrew. We have a feature request for the ability to export and share individual steps (and also combine an imported step with a local step):

You can add your vote and feedback to this feature request to express your interest.

Please feel free to reach out if you need anything further.

Kind regards,
Theodora

Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 2, 2024

Hi @Andrew McMorris ,

If you are still looking for this, I wanted to let you know that we recently introduced Dynamic Pipelines which allows you to add a single step (or a few) to multiple pipelines..

I just published this article explaining how to add a step.

Hope you'll find this useful,
Caterina

Like Theodora Boudale likes this
Andrew McMorris June 3, 2024

Thanks @Caterina Curti will take a look, not sure we are sold with Dynamic Pipelines tbh, as it feels a rather over complicated solution as we don't want to spend lots of Dev effort into maintaining our pipelines.

Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 3, 2024

Thanks for sharing , @Andrew McMorris. Dynamic Pipelines provide a lot of flexibility, and that's key to managing pipelines at scale for most customers. We realized that this wouldn't be possible with configuration options.

It should be pretty easy to get started, I'm also available for a 1:1 session if you like to spend some time with me setting them up. Just reply here.

Like Andrew McMorris likes this
1 vote
Aron Gombas _Midori_
Community Champion
October 6, 2023

You may want to show also the other pipeline where you import and reuse it.

0 votes
Veeresh September 6, 2024

Is this issue resolved? I am still unable to import the share-pipeline-1 to import repository, I dont see the pipeline being triggered at import repository. Please advise on how to import the share-pipeline or yaml anchor steps from export repo to import repository in bitbucket. Below example doesn't seems to work.

 

Export repository:

export: true

definitions:
  pipelines:
    share-pipeline-1:
      - step:
          name: "hello world"
          script:
            - echo hello


Import repository:

pipelines:
  custom:
    import-pipeline:
      import: shared-pipeline:main:share-pipeline-1

Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 9, 2024

Hi @Veeresh

Let me start by welcoming you to the community.

To achieve this, you'll need to use Dynamic Pipelines which allow you to add a single step (or a few) to multiple pipelines.

Here is an article explaining how to add a step, hopefully this will help you get started.

Caterina

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events