How to divide reusable tasks yet using a single Docker container?

Hello there !

I am new to Bitbucket pipelines coming from Jenkins.
I want to have a pipeline with the following tasks:

  1. Setup Javascript dependencies
  2. Lint code
  3. Generate doc
  4. Execute tests
  5. Report tests results to PR

I implemented those tasks using multiple step .
All steps are using the same Docker container which is cached and restored for each step which. This process of caching/restoring is time consuming.
Also, those steps are defined and then used as YAML anchors and references to avoid duplication: reshuffled steps depending on the branch (a feature branch, develop, main, …).

My question: Is there a way to get all the following:

  • Simple tasks reusable (just like step and YAML reference)
  • All tasks using the same Docker container without cache/restore
  • Visual representation in the Pipeline layout of the individual tasks to quickly identify where the issue, if any, was raised.

Thanks for your support !


I think you will have more luck asking this question over at the Atlassian Community forum. The developer forum is focussed on developing apps for Atlassian products and is less suitable for asking end-user questions on how to use the Atlassian products.



Thanks @remie. Will do.

New post here in the community forum.