Use a custom docker image for builds (#1467)

* use new dockerfile

* don't use an entrypoint

* try simpler

* run bazelisk

* try removing params


Former-commit-id: 8a8e5f92d943b0d836a7b2c2a69f69ee2a3b1831
This commit is contained in:
2022-03-07 19:24:34 -08:00
committed by GitHub
parent 36ac36def4
commit 87cb19f0cc
3 changed files with 18 additions and 50 deletions
+5 -50
View File
@@ -4,40 +4,9 @@ version: 2.1
commands:
setup-tools:
parameters:
bazel-version:
type: string
description: |
Setup the Bazel build system used for building Android projects
Setup the Bazel build system used for building bazel projects
steps:
- run:
name: Add Bazel Apt repository
command: |
sudo apt install curl gnupg
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
- run:
name: Install Bazel from Apt
command: |
sudo apt update && sudo apt -y install <<parameters.bazel-version>>
sudo update-alternatives --install /usr/bin/bazel bazel /usr/bin/<<parameters.bazel-version>> 10
sudo update-alternatives --set bazel /usr/bin/bazel-5.0.0
- run:
name: Choose the gcc version
command: |
sudo apt -y install gcc-10 g++-10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
sudo update-alternatives --set gcc /usr/bin/gcc-10
sudo update-alternatives --set g++ /usr/bin/g++-10
- run:
name: Install python
command: sudo apt -y install python
- run:
name: Install bazels3cache
command: sudo npm install -g bazels3cache
- run:
name: Run bazels3cache
command: bazels3cache --bucket=eagle0bazel
@@ -65,20 +34,13 @@ commands:
jobs:
test:
docker:
- image: cimg/openjdk:11.0-node
- image: nolen777/circleci-bazelisk:0.0.3
resource_class: large
parameters:
bazel-version:
description: "Pinned Bazel version"
default: "bazel-5.0.0"
type: string
steps:
- checkout
- setup-tools:
bazel-version: <<parameters.bazel-version>>
- setup-tools
- setup-secret
- run:
name: Run tests
@@ -86,20 +48,13 @@ jobs:
build:
docker:
- image: cimg/openjdk:11.0-node
- image: nolen777/circleci-bazelisk:0.0.3
resource_class: large
parameters:
bazel-version:
description: "Pinned Bazel version"
default: "bazel-5.0.0"
type: string
steps:
- checkout
- setup-tools:
bazel-version: <<parameters.bazel-version>>
- setup-tools
- setup-secret
- run:
name: Build servers
+1
View File
@@ -0,0 +1 @@
../../.bazelversion
+12
View File
@@ -0,0 +1,12 @@
FROM cimg/openjdk:11.0-node
RUN sudo npm install -g @bazel/bazelisk
RUN bazelisk
RUN sudo apt -y update
RUN sudo apt -y install gcc-10 g++-10 && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10 && \
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10 && \
sudo update-alternatives --set gcc /usr/bin/gcc-10 && \
sudo update-alternatives --set g++ /usr/bin/g++-10
RUN sudo apt -y install python
RUN sudo npm install -g bazels3cache