From 528e47b5cf39167e8404e33dc9f2f53e7dcbae1f Mon Sep 17 00:00:00 2001 From: "Andreas Penski (init)" Date: Mon, 3 Jun 2019 15:47:54 +0200 Subject: [PATCH] (WIP) build ohne docker --- .gitlab-ci.yml | 26 +- pom.xml | 311 ++++-------------- .../de/kosit/validationtool/cmd/DaemonIT.java | 8 +- 3 files changed, 83 insertions(+), 262 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index da97003..b51d655 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,13 +7,12 @@ cache: paths: - repository -build-validator: +build-java-latest: stage: build script: - - mvn $MAVEN_CLI_OPTS -Pjava-11,java-8,gitlab verify - + - mvn $MAVEN_CLI_OPTS verify artifacts: - name: build-results + name: java-latest paths: - target/*.jar reports: @@ -21,9 +20,16 @@ build-validator: - target/surefire-reports/*.xml - target/failsafe-reports/*.xml -#deploy: -# stage: deploy -# script: -# - mvn $MAVEN_CLI_OPTS deploy -# only: -# - master +build-java8: + stage: build + image: maven:3-jdk-8-alpine + script: + - mvn $MAVEN_CLI_OPTS verify + artifacts: + name: java8 + paths: + - target/*.jar + reports: + junit: + - target/surefire-reports/*.xml + - target/failsafe-reports/*.xml diff --git a/pom.xml b/pom.xml index a007283..3a87f72 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,6 @@ 1.18.6 9.9.1-3 1.7.25 - localhost @@ -365,256 +364,72 @@ + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + run + pre-integration-test + + exec + + + + + java + true + true + true + + -classpath + + de.kosit.validationtool.cmd.CommandLineApplication + -s + src/main/docker/daemon/config/scenarios.xml + -D + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + + + + + + sleep-for-a-while + pre-integration-test + + run + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.22.1 + + + test-java8 + + integration-test + verify + + + + + + - - - java-8 - - - - org.apache.maven.plugins - maven-failsafe-plugin - 2.22.1 - - - test-java8 - - integration-test - verify - - - - - -Ddaemon.port=8081 - -Ddaemon.host=http://${docker.host} - - ${project.build.directory}/failsafe-reports/failsafe-summary-java8.xml - - - - test-java-8-jdk-jaxb - - integration-test - verify - - - - - -Ddaemon.port=8082 - -Ddaemon.host=http://${docker.host} - - ${project.build.directory}/failsafe-reports/failsafe-summary-java8-jdk-jaxb.xml - - - - - - - - io.fabric8 - docker-maven-plugin - 0.28.0 - - tcp://${docker.host}:2375 - true - true - false - validator-%n-%t-%i-java8 - - - - - up8 - pre-integration-test - - build - start - - - - - daemon8 - daemon8 - - daemon - Dockerfile-java8 - - - - - - ${project.build.directory}/validationtool-${project.version}-standalone.jar - - validationtool-standalone.jar - - - - - - - - bridge - - - 8081:8080 - - - - - - - - daemon8-jdk-jaxb - daemon8-jdk-jaxb - - daemon - Dockerfile-java8-jdk-jaxb - - - - - - ${project.build.directory}/validationtool-${project.version}-java8-standalone.jar - - validationtool-standalone.jar - - - - - - - - bridge - - - 8082:8080 - - - - - - - - - - - down8 - post-integration-test - - stop - - - - - - - - - - java-11 - - true - - - - - org.apache.maven.plugins - maven-failsafe-plugin - 2.22.1 - - - test-jdk11 - - integration-test - verify - - - - - -Ddaemon.port=8080 - -Ddaemon.host=http://${docker.host} - - - - - - - - io.fabric8 - docker-maven-plugin - 0.28.0 - - tcp://${docker.host}:2375 - true - true - false - validator-%n-%t-%i-java8 - - - - up11 - pre-integration-test - - build - start - - - - - daemon11 - daemon11 - - daemon - - - - - - ${project.build.directory}/validationtool-${project.version}-standalone.jar - - validationtool-standalone.jar - - - - - - - - bridge - - - 8080:8080 - - - - - - - - - - - down11 - post-integration-test - - stop - - - - - - - - - - gitlab - - host.docker.internal - - - https://github.com/itplr-kosit/validationtool.git scm:git:https://github.com/itplr-kosit/validationtool.git diff --git a/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java b/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java index 52b521f..a2311bc 100644 --- a/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java +++ b/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java @@ -41,7 +41,7 @@ public class DaemonIT { @Test public void makeSureThatSuccessTest() throws IOException { - try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) { + try ( final InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) { given().contentType(ContentType.XML).body(toContent(io)).when().post("/").then().statusCode(200); } } @@ -54,12 +54,12 @@ public class DaemonIT { @Test @Ignore // no default error report yet public void internalServerErrorTest() throws IOException { - try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(INVALID_XML) ) { + try ( final InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(INVALID_XML) ) { given().contentType(APPLICATION_XML).body(toContent(io)).when().post("/").then().statusCode(200); } } - private byte[] toContent(final InputStream io) throws IOException { + private static byte[] toContent(final InputStream io) throws IOException { return IOUtils.toByteArray(io); } @@ -75,7 +75,7 @@ public class DaemonIT { @Test public void xmlResultTest() throws IOException { - try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) { + try ( final InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) { given().body(toContent(io)).when().post("/").then().contentType(APPLICATION_XML).and().statusCode(200); } }