Forums

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

reusable ‘blocks’ of CI/CD workflows

Wesley de Menezes Flor
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 12, 2024

Hello everyone, I hope you are well!

The dynamic pipeline documentation has some examples of things that can be done, including: Creating standardized and reusable ‘blocks’ of CI/CD workflows that can be defined & shared by platform engineering teams, and then consumed by multiple engineering teams within an organization

That's exactly my situation :D. I'm part of the platform team, and we would like to create these ci/cd workflow blocks and share them with the organization.

For example: Java application, I need workflow the following steps:

- Build & Test

- SonarQube Test

- SAST Tool Test

- Docker Build & Push

- Deploy to K8S

Would each step be a forge app? How do I reference forge apps in the bitbucket-pipelines.yml file? Can you help with what the strategy would be like to create these reusable blocks?

 

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

Reading the documentation I understood that the repository can only be linked to a "dynamic pipeline provider". How can I share steps with just one provider/forge app?

2 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 13, 2024

Hi Wesley and welcome to the community!

I recommend posting your questions in this group, as it is specifically for Forge with Bitbucket Cloud:

As far as I'm aware, forge apps are not referenced in the bitbucket-pipelines.yml. After you deploy and install a Forge app, you can enable the dynamic pipeline in either your workspace (Workspace settings -> Pipelines -> Dynamic pipelines) or in a repository (Repository settings -> Pipelines -> Dynamic pipelines).

We have this repository of sample Dynamic Pipelines apps for Bitbucket Cloud:

I haven't been involved with dynamic pipelines so I can't answer all your questions, I suggest posting in the community group I shared.

You may also want to consider the Shared Pipelines Configuration feature:

This allows you to use pipelines defined in one repo in the bitbucket-pipelines.yml of a different repo in the same Bitbucket workspace.

Kind regards,
Theodora

0 votes
Aron Gombas _Midori_
Community Champion
November 12, 2024

@Wesley de Menezes Flor Because developing a Forge app has a learning curve, before you dive into that, I suggest you have a look at this:

https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/

In nutshell: you can have reusable blocks  in YAML without programming. (It is less flexible, but if it meets your requirements, then it is much faster to implement.)

Wesley de Menezes Flor
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 12, 2024

Aron, thanks for the quick response.

I saw this yaml-anchors documentation, but it doesn't solve my problem, because the blocks are shareable within the bitbucket-pipelines.yml file of a single repository.

I need to create a STEP that can be used in the pipeline of many repositories.

The learning curve is not a problem. My team and I know javascript/nodejs (the language used by forge). I just need some guidance or more comprehensive documentation. The documentation says it's possible to do it but doesn't explain how. That's why I'm asking the community for help.

Aron Gombas _Midori_
Community Champion
December 18, 2024

If so, @Theodora Boudale posted the best link to follow for a working example: https://bitbucket.org/atlassian/forge-bitbucket-dynamic-pipelines-reference-apps/src/main/

Good luck with your project!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events