Gerrit image cleanups/fixes
We name the base image we build gerrit-base and we expose port 8081 not 8080 as opendev's gerrit listens on 8081. Also explicitly build the javamelody plugin deps jar and copy it into the review_site/lib dir on Gerrit 2 bazel builds. This is necessary according to javamelody plugin build docs. In order to split Gerrit 2.x and 3.x behavior in the Bazel builds we convert our Dockerfile into a multi stage build. All this ended up down a thread pull where the script in the Dockerfile dir called build-gerrit.sh isn't actually used to build gerrit :/ clarify that. The script may be useful for local builds so we haven't removed it yet. Finally update gerrit plugin checkouts to tags or master as appropriate where stable branches don't exist for the specified version. Change-Id: I155a20685b3462e965c4216d134b3b36978fbcc7
This commit is contained in:
parent
6494ed0275
commit
3279a7ec10
@ -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…
x
Reference in New Issue
Block a user