Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I use Bazel with pipelines?

I want to use the  Bazel build tool to create my artifacts on the pipelines. What would be the best way to install and use bazel in the pipelines so I can have cached builds? Has anyone ever got it to work?

2 answers

I got bazel to work in a pipeline and reuse the cached arifacts. Caching the default ~/.cache/bazel directory didn't work for me (complained about corrupt installation on repeated builds), but using --disk_cache flag did. Something like the following:


- step:
- bazel
- bazel test --disk_cache=~/.cache/my-bazel //...
bazel: ~/.cache/my-bazel
1 vote

Hi Victor,

For running and install Bazel, you can do so similar as in a normal Bash environment. You can also use a Docker image from DockerHub that already has Basel installed. There are currently no official Bazel images, so you will need a community created one.

Documentation on configuring Docker images:

For caching, you configure specific directories to be cached. So in this case, you can use cache directories from Bazel.

Bazel provides some documentation on default caches here:

Pipelines Cache documentation can be found here:



Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

214 views 2 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you