Skip to content
Permalink
Browse files

[JENKINS-48711] - Enable Multi-stage build for PCT

  • Loading branch information
oleg-nenashev committed Feb 16, 2018
1 parent b17dead commit a7e5c580b4c22c36c612cd3b42dfbe091105876d
Showing with 12 additions and 19 deletions.
  1. +12 −19 Dockerfile
@@ -20,33 +20,26 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

FROM maven:3.5.2-jdk-8
FROM maven:3.5.2-jdk-8 as builder
LABEL Description="Base image for running Jenkins Plugin Compat Tester (PCT) against custom plugins and Jenkins cores" Vendor="Jenkins project"

# Mode 1. Copy local artifact
# Local build (uncomment and remove the section below if needed)
COPY plugins-compat-tester-cli/target/plugins-compat-tester-cli-*.jar /pct/pct-cli.jar

# Mode 2. Build artifact from sources in Docker
# Use this flow if you do not want to build the binary on a local machine
# This mode is ineffective from the container size PoV and the layer number
# https://issues.jenkins-ci.org/browse/INFRA-1447
# Copy sources
#COPY plugins-compat-tester/ /pct/src/plugins-compat-tester/
#COPY plugins-compat-tester-cli/ /pct/src/plugins-compat-tester-cli/
#COPY plugins-compat-tester-gae/ /pct/src/plugins-compat-tester-gae/
#COPY plugins-compat-tester-gae-client/ /pct/src/plugins-compat-tester-gae-client/
#COPY plugins-compat-tester-model/ /pct/src/plugins-compat-tester-model/
#COPY *.xml /pct/src/
#COPY LICENSE.txt /pct/src/LICENSE.txt
COPY plugins-compat-tester/ /pct/src/plugins-compat-tester/
COPY plugins-compat-tester-cli/ /pct/src/plugins-compat-tester-cli/
COPY plugins-compat-tester-gae/ /pct/src/plugins-compat-tester-gae/
COPY plugins-compat-tester-gae-client/ /pct/src/plugins-compat-tester-gae-client/
COPY plugins-compat-tester-model/ /pct/src/plugins-compat-tester-model/
COPY *.xml /pct/src/
COPY LICENSE.txt /pct/src/LICENSE.txt

#WORKDIR /pct/src/
#RUN mvn clean install -DskipTests && cp plugins-compat-tester-cli/target/plugins-compat-tester-cli-*.jar /pct/pct-cli.jar && mvn clean && mvn dependency:purge-local-repository
WORKDIR /pct/src/
RUN mvn clean install -DskipTests

FROM maven:3.5.2-jdk-8
ENV JENKINS_WAR_PATH=/pct/jenkins.war
ENV PCT_OUTPUT_DIR=/pct/out
ENV PCT_TMP=/pct/tmp

COPY --from=builder /pct/src/plugins-compat-tester-cli/target/plugins-compat-tester-cli-*.jar /pct/pct-cli.jar
COPY src/main/docker/run-pct.sh /usr/local/bin/run-pct
COPY src/main/docker/pct-default-settings.xml /pct/default-m2-settings.xml

0 comments on commit a7e5c58

Please sign in to comment.
You can’t perform that action at this time.