Skip to content

Commit

Permalink
Merge pull request #137 from dduportal/gh-134
Browse files Browse the repository at this point in the history
chore: migrate pipeline to infra.ci and use eclipse-temurin instead (deprecated) openjdk
  • Loading branch information
dduportal authored Aug 17, 2022
2 parents 16aca16 + 64c27fa commit a97f58d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 55 deletions.
35 changes: 20 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
FROM jetty:jre8
FROM eclipse-temurin:8 AS build

WORKDIR /app
COPY . .
RUN ./gradlew --no-daemon --info war

FROM jetty:jre8 AS production

LABEL \
Description="Deploy Jenkins infra account app" \
Project="https://github.com/jenkins-infra/account-app" \
Maintainer="[email protected]"
description="Deploy Jenkins infra account app" \
project="https://github.com/jenkins-infra/account-app" \
maintainer="[email protected]"

ENV STV_GIT_COMMIT="fdb6dfdbc171d3e91bd98dd85bc2fbcea8aa2a7a"
ENV STV_GIT_URL="https://github.com/louridas/stv.git"
ENV ELECTION_LOGDIR=/var/log/accountapp/elections
ENV CIRCUIT_BREAKER_FILE=/etc/accountapp/circuitBreaker.txt
ENV SMTP_SERVER=localhost
Expand All @@ -18,18 +22,19 @@ EXPOSE 8080

USER root

## Always use latest available version of these packages
# hadolint ignore=DL3008
RUN \
apt-get update && \
apt-get install -y git python && \
rm -rf /var/lib/apt/lists/* && \
mkdir -p /opt/stv && \
git clone $STV_GIT_URL /opt/stv && \
cd /opt/stv && \
git checkout $STV_GIT_COMMIT
apt-get install --yes --no-install-recommends python && \
rm -rf /var/lib/apt/lists/*

## Install the STV Election projects (which requires python)
ARG STV_GIT_COMMIT="fdb6dfdbc171d3e91bd98dd85bc2fbcea8aa2a7a"
ADD "https://github.com/louridas/stv/archive/${STV_GIT_COMMIT}.tar.gz" /opt/stv

# /home/jetty/.app is apparently needed by Stapler for some weird reason. O_O
RUN \
mkdir -p /opt/stv && \
mkdir -p /home/jetty/.app &&\
mkdir -p /etc/accountapp &&\
mkdir -p $ELECTION_LOGDIR
Expand All @@ -40,7 +45,7 @@ COPY entrypoint.sh /entrypoint.sh

ADD https://search.maven.org/remote_content?g=com.datadoghq&a=dd-java-agent&v=0.9.0 /home/jetty/dd-java-agent.jar

COPY build/libs/accountapp*.war /var/lib/jetty/webapps/ROOT.war
COPY --chown=jetty:root --from=build /app/build/libs/accountapp*.war /var/lib/jetty/webapps/ROOT.war

RUN chmod 0755 /entrypoint.sh &&\
chown -R jetty:root /etc/accountapp &&\
Expand All @@ -51,4 +56,4 @@ RUN chmod 0755 /entrypoint.sh &&\

USER jetty

ENTRYPOINT /entrypoint.sh
ENTRYPOINT ["bash","/entrypoint.sh"]
40 changes: 0 additions & 40 deletions Jenkinsfile

This file was deleted.

1 change: 1 addition & 0 deletions Jenkinsfile_k8s
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
parallelDockerUpdatecli([imageName: 'account-app', rebuildImageOnPeriodicJob: false])

0 comments on commit a97f58d

Please sign in to comment.