Merge "Gerrit image cleanups/fixes"

changes/18/746618/1
Zuul 2 years ago committed by Gerrit Code Review
commit 4798390909

@ -18,7 +18,7 @@ FROM docker.io/opendevorg/python-builder:3.7 as builder
COPY . /tmp/src
RUN assemble
FROM docker.io/library/openjdk:8
FROM docker.io/library/openjdk:8 as gerrit-base
RUN echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/95disable-recommends
@ -55,7 +55,8 @@ RUN mkdir /var/gerrit/lib && \
wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.43/mysql-connector-java-5.1.43.jar -O /var/gerrit/lib/mysql-connector-java.jar
# Allow incoming traffic
EXPOSE 29418 8080
# OpenDev Gerrit listens on 8081 not default of 8080
EXPOSE 29418 8081
VOLUME /var/gerrit/git /var/gerrit/index /var/gerrit/cache /var/gerrit/db /var/gerrit/etc /var/log/gerrit /var/gerrit/tmp

@ -13,10 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM docker.io/opendevorg/gerrit-base
FROM docker.io/opendevorg/gerrit-base as gerrit
COPY release.war /var/gerrit/bin/gerrit.war
# Install plugins
RUN mkdir /var/gerrit/plugins && \
unzip -jo /var/gerrit/bin/gerrit.war WEB-INF/plugins/* -d /var/gerrit/plugins
FROM gerrit as gerrit-2
# Only Gerrit 2.14, 2.15, and 2.16 need this COPY
COPY javamelody-deps_deploy.jar /var/gerrit/lib/javamelody-deps_deploy.jar

@ -1,9 +1,12 @@
#!/bin/bash
# Note this script doesn't seem to be used by the image builds.
# The system-config/roles/bazelisk-build role seems to be used instead.
set +x
for attempt in seq 1 3 ; do
bazel build release \
bazel build plugins/javamelody:javamelody-deps_deploy.jar 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 \

@ -5,7 +5,7 @@ Runs bazelisk build with the specified targets.
**Role Variables**
.. zuul:rolevar:: bazelisk_targets
:default: ""
:default: "release"
The bazelisk targets to build.

@ -1,8 +1,13 @@
- name: Run bazelisk build
shell: |
set -x
java -fullversion
{{ bazelisk_executable }} version
{{ bazelisk_executable }} build --spawn_strategy=standalone --genrule_strategy=standalone {{ bazelisk_targets }}
if [[ -f bazel-bin/plugins/javamelody/javamelody-deps_deploy.jar ]] ; then
# versions 2.14, 2.15, and 2.16 generate this file
cp bazel-bin/plugins/javamelody/javamelody-deps_deploy.jar javamelody-deps_deploy.jar
fi
# release.war is a symlink. We want an actual file so that docker copy works right.
cp bazel-bin/release.war release.war
args:

@ -89,7 +89,7 @@
- name: gerrit.googlesource.com/gerrit
override-checkout: stable-2.14
- name: gerrit.googlesource.com/plugins/commit-message-length-validator
override-checkout: stable-2.14
override-checkout: v2.14.21
- name: gerrit.googlesource.com/plugins/download-commands
override-checkout: stable-2.14
- name: gerrit.googlesource.com/plugins/hooks
@ -107,9 +107,11 @@
- name: gerrit.googlesource.com/plugins/singleusergroup
override-checkout: stable-2.14
vars: &gerrit_vars_2_14
bazelisk_targets: "plugins/javamelody:javamelody-deps_deploy.jar release"
docker_images:
- context: docker/gerrit/bazel
repository: opendevorg/gerrit
target: gerrit-2
path: /home/zuul/src/gerrit.googlesource.com/gerrit
tags:
- 2.14
@ -153,7 +155,7 @@
- name: gerrit.googlesource.com/gerrit
override-checkout: stable-2.15
- name: gerrit.googlesource.com/plugins/commit-message-length-validator
override-checkout: stable-2.15
override-checkout: v2.15.19
- name: gerrit.googlesource.com/plugins/download-commands
override-checkout: stable-2.15
- name: gerrit.googlesource.com/plugins/hooks
@ -171,9 +173,11 @@
- name: gerrit.googlesource.com/plugins/singleusergroup
override-checkout: stable-2.15
vars: &gerrit_vars_2_15
bazelisk_targets: "plugins/javamelody:javamelody-deps_deploy.jar release"
docker_images:
- context: docker/gerrit/bazel
repository: opendevorg/gerrit
target: gerrit-2
path: /home/zuul/src/gerrit.googlesource.com/gerrit
tags:
- 2.15
@ -217,9 +221,9 @@
- name: gerrit.googlesource.com/gerrit
override-checkout: stable-2.16
- name: gerrit.googlesource.com/plugins/codemirror-editor
override-checkout: stable-2.16
override-checkout: v2.16.22
- name: gerrit.googlesource.com/plugins/commit-message-length-validator
override-checkout: stable-2.16
override-checkout: v2.16.22
- name: gerrit.googlesource.com/plugins/download-commands
override-checkout: stable-2.16
- name: gerrit.googlesource.com/plugins/hooks
@ -227,7 +231,8 @@
- name: gerrit.googlesource.com/plugins/its-base
override-checkout: stable-2.16
- name: gerrit.googlesource.com/plugins/its-storyboard
override-checkout: stable-2.16
# There is no 2.16 branch
override-checkout: master
- name: gerrit.googlesource.com/plugins/javamelody
override-checkout: stable-2.16
- name: gerrit.googlesource.com/plugins/replication
@ -237,9 +242,11 @@
- name: gerrit.googlesource.com/plugins/singleusergroup
override-checkout: stable-2.16
vars: &gerrit_vars_2_16
bazelisk_targets: "plugins/javamelody:javamelody-deps_deploy.jar release"
docker_images:
- context: docker/gerrit/bazel
repository: opendevorg/gerrit
target: gerrit-2
path: /home/zuul/src/gerrit.googlesource.com/gerrit
tags:
- 2.16
@ -285,13 +292,13 @@
- name: gerrit.googlesource.com/gerrit
override-checkout: stable-3.0
- name: gerrit.googlesource.com/plugins/codemirror-editor
override-checkout: stable-3.0
override-checkout: v3.0.12
- name: gerrit.googlesource.com/plugins/commit-message-length-validator
override-checkout: stable-3.0
override-checkout: v3.0.12
- name: gerrit.googlesource.com/plugins/delete-project
override-checkout: stable-3.0
- name: gerrit.googlesource.com/plugins/download-commands
override-checkout: stable-3.0
override-checkout: v3.0.12
- name: gerrit.googlesource.com/plugins/gitiles
override-checkout: stable-3.0
- name: gerrit.googlesource.com/plugins/hooks
@ -299,7 +306,8 @@
- name: gerrit.googlesource.com/plugins/its-base
override-checkout: stable-3.0
- name: gerrit.googlesource.com/plugins/its-storyboard
override-checkout: stable-3.0
# There is no 3.0 branch
override-checkout: master
- name: gerrit.googlesource.com/plugins/javamelody
override-checkout: stable-3.0
- name: gerrit.googlesource.com/plugins/plugin-manager
@ -316,6 +324,7 @@
docker_images:
- context: docker/gerrit/bazel
repository: opendevorg/gerrit
target: gerrit
path: /home/zuul/src/gerrit.googlesource.com/gerrit
tags:
- 3.0
@ -389,6 +398,7 @@
docker_images:
- context: docker/gerrit/bazel
repository: opendevorg/gerrit
target: gerrit
path: /home/zuul/src/gerrit.googlesource.com/gerrit
tags:
- master

Loading…
Cancel
Save