Remove the extra bazel options

We had some extra bazel options that don't seem to be necessary
anymore now that we are using upstream bazel options appropriately.

Retry the build a couple of times if it goes south, inside of the
build image. This should allow re-use of the cache the second time,
and if there is a temporary error, it should pick up and move
forward.

Change-Id: I5f304acb21fd3a4d40701fc0414ae0c424c838e5
This commit is contained in:
Monty Taylor 2019-08-25 11:32:54 +02:00
parent 80981a52c8
commit 56ceaf1c40
3 changed files with 21 additions and 12 deletions

View File

@ -36,18 +36,7 @@ USER builder
COPY . /usr/src
ARG BAZEL_OPTS
RUN cd /usr/src \
&& bazel build release \
--local_ram_resources=3072 \
--local_cpu_resources=1 \
--host_force_python=PY3 \
--incompatible_string_join_requires_strings=false \
--define=ABSOLUTE_JAVABASE=/usr/lib/jvm/java-8-openjdk-amd64 \
--javabase=@bazel_tools//tools/jdk:absolute_javabase \
--host_javabase=@bazel_tools//tools/jdk:absolute_javabase \
--host_java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla \
--java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla \
${BAZEL_OPTS}
RUN cd /usr/src && bash build-gerrit.sh
FROM openjdk:8

View File

@ -0,0 +1,15 @@
#!/bin/bash
set +x
for attempt in seq 1 3 ; do
bazel build release \
--define=ABSOLUTE_JAVABASE=/usr/lib/jvm/java-8-openjdk-amd64 \
--javabase=@bazel_tools//tools/jdk:absolute_javabase \
--host_javabase=@bazel_tools//tools/jdk:absolute_javabase \
--host_java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla \
--java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla \
$@
result=$?
done
exit $result

View File

@ -47,3 +47,8 @@
force: yes
src: javamelody/external_plugin_deps.bzl
path: /home/zuul/src/gerrit.googlesource.com/gerrit/plugins/external_plugin_deps.bzl
- name: Move build script into main gerrit source dir
command: "mv docker/gerrit/bazel/build-gerrit.sh /home/zuul/src/gerrit.googlesource.com/gerrit"
args:
chdir: /home/zuul/src/opendev.org/opendev/system-config