You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
For now the bitbucket pipeline clones the repo in every step.
But is there a way of just cloning once and sharing the repo files like a cache?
Or do we have to make the repo as an artifact after cloning?
Welcome to Atlassian Community!
Just to give you a little background, Pipelines uses a server-less infrastructure, meaning that the build containers are only provisioned on demand. When your pipeline build starts, it starts a docker container with the image that you provide on the YML file, and run the script commands that you have configured. The build setup includes the following steps :
That being said, since every build step runs in a separate docker container, each time a step starts it will clone the repository by default.
At this moment, if you want to use the repo folder in next steps but don't want to clone it again, the only option is by creating an artifact of the repository directory, as you mentioned.
You can also use the following alternatives to improve your build :
clone: depth: 5 # include the last five commits, for example pipelines: default: - step: name: Cloning script: - echo "Clone just five commits!"
- step: clone: enabled: false script: - echo "test"
Hope that helps to address your questions! :)