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?
Hello Marcus,
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! :)
Kind regards,
Patrik S
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.