I'm using Bitbucket Pipelines and I have a question about it.
I want to build my repository on Ubuntu 20.04. The essential tools I need are as follows:
- gcc 9, g++ 9
- cmake
- openjdk8, openjdk17, openjre17
- ant
I am currently installing all the software each time I build using the following command:
apt-get update && apt-get install -y gcc-9 g++-9 cmake openjdk-8-jdk openjdk-17-jre openjdk-17-jdk ant
This is inefficient.
I want to know how to cache the tools I've installed once. How should I write my bitbucket-pipelines.yml?
Below is part of my yml file
image: atlassian/default-image:latest
pipelines:
default:
- step:
name: Build on Ubuntu 20.04
image: ubuntu:20.04
script:
- apt-get update && apt-get install -y gcc-9 g++-9 cmake openjdk-8-jdk openjdk-17-jre openjdk-17-jdk ant