Skip to content

Commit

Permalink
feat: add 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
richardtin committed May 24, 2023
1 parent 9eb1dda commit a7273ab
Show file tree
Hide file tree
Showing 7 changed files with 479 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
context: [3.5, 3.6, 3.7]
context: [3.6, 3.7, 3.8]
include:
- context: 3.5
version: 3.5.5
- context: 3.6
version: 3.6.4
version: 3.6.5
- context: 3.7
version: 3.7.2
version: 3.7.3
- context: 3.8
version: 3.8.0
permissions:
contents: read
packages: write
Expand Down
2 changes: 1 addition & 1 deletion 3.6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM adoptopenjdk/openjdk11:alpine-jre
ENV GERRIT_HOME /var/gerrit
ENV GERRIT_SITE ${GERRIT_HOME}/review_site
ENV GERRIT_WAR ${GERRIT_HOME}/gerrit.war
ENV GERRIT_VERSION 3.6.4
ENV GERRIT_VERSION 3.6.5
ENV GERRIT_USER gerrit2
ENV GERRIT_INIT_ARGS "--install-plugin=delete-project --install-plugin=gitiles --install-plugin=plugin-manager"

Expand Down
2 changes: 1 addition & 1 deletion 3.7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM adoptopenjdk/openjdk11:alpine-jre
ENV GERRIT_HOME /var/gerrit
ENV GERRIT_SITE ${GERRIT_HOME}/review_site
ENV GERRIT_WAR ${GERRIT_HOME}/gerrit.war
ENV GERRIT_VERSION 3.7.2
ENV GERRIT_VERSION 3.7.3
ENV GERRIT_USER gerrit2
ENV GERRIT_INIT_ARGS "--install-plugin=delete-project --install-plugin=gitiles --install-plugin=plugin-manager"

Expand Down
63 changes: 63 additions & 0 deletions 3.8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
FROM adoptopenjdk/openjdk11:alpine-jre

# Overridable defaults
ENV GERRIT_HOME /var/gerrit
ENV GERRIT_SITE ${GERRIT_HOME}/review_site
ENV GERRIT_WAR ${GERRIT_HOME}/gerrit.war
ENV GERRIT_VERSION 3.8.0
ENV GERRIT_USER gerrit2
ENV GERRIT_INIT_ARGS "--install-plugin=delete-project --install-plugin=gitiles --install-plugin=plugin-manager"

# Add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN adduser -D -h "${GERRIT_HOME}" -g "Gerrit User" -s /sbin/nologin "${GERRIT_USER}"

RUN set -x \
&& apk add --update --no-cache git openssh-client openssl bash perl perl-cgi git-gitweb curl su-exec

RUN mkdir /docker-entrypoint-init.d

#Download gerrit.war
RUN curl -fSsL https://gerrit-releases.storage.googleapis.com/gerrit-${GERRIT_VERSION}.war -o $GERRIT_WAR
#Only for local test
#COPY gerrit-${GERRIT_VERSION}.war $GERRIT_WAR

#Download Plugins
ENV PLUGIN_VERSION=3.8
ENV GERRITFORGE_URL=https://gerrit-ci.gerritforge.com
ENV GERRITFORGE_ARTIFACT_DIR=lastSuccessfulBuild/artifact/bazel-bin/plugins

#events-log
#This plugin is required by gerrit-trigger plugin of Jenkins.
RUN curl -fSsL \
${GERRITFORGE_URL}/job/plugin-events-log-bazel-master-stable-${PLUGIN_VERSION}/${GERRITFORGE_ARTIFACT_DIR}/events-log/events-log.jar \
-o ${GERRIT_HOME}/events-log.jar

#oauth2
RUN curl -fSsL \
${GERRITFORGE_URL}/job/plugin-oauth-bazel-master-stable-${PLUGIN_VERSION}/${GERRITFORGE_ARTIFACT_DIR}/oauth/oauth.jar \
-o ${GERRIT_HOME}/oauth.jar

#importer
# Not ready for 3.0
#RUN curl -fSsL \
# ${GERRITFORGE_URL}/job/plugin-importer-${PLUGIN_VERSION}/${GERRITFORGE_ARTIFACT_DIR}/importer/importer.jar \
# -o ${GERRIT_HOME}/importer.jar

# Ensure the entrypoint scripts are in a fixed location
COPY gerrit-entrypoint.sh /
COPY gerrit-start.sh /
RUN chmod +x /gerrit*.sh

#A directory has to be created before a volume is mounted to it.
#So gerrit user can own this directory.
RUN su-exec ${GERRIT_USER} mkdir -p $GERRIT_SITE

#Gerrit site directory is a volume, so configuration and repositories
#can be persisted and survive image upgrades.
VOLUME $GERRIT_SITE

ENTRYPOINT ["/gerrit-entrypoint.sh"]

EXPOSE 8080 29418

CMD ["/gerrit-start.sh"]
Loading

0 comments on commit a7273ab

Please sign in to comment.