Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and deploy docker images #129

Merged
merged 8 commits into from
Oct 8, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<jacoco-plugin.version>0.8.6</jacoco-plugin.version>
<project-info-reports-plugin.version>3.1.1</project-info-reports-plugin.version>
<maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
<dockerfile-maven-plugin.version>1.4.13</dockerfile-maven-plugin.version>
dnlkoch marked this conversation as resolved.
Show resolved Hide resolved

<!-- Javax -->
<javax.servlet.api.version>4.0.1</javax.servlet.api.version>
Expand Down Expand Up @@ -131,7 +132,6 @@
<!-- GeoServer/Geodata -->
<geoserver-manager.version>1.7.0</geoserver-manager.version>
<jts.version>1.17.1</jts.version>

</properties>

<build>
Expand Down Expand Up @@ -170,6 +170,7 @@
<version>${spring-boot.version}</version>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>build-info</goal>
</goals>
Expand All @@ -180,13 +181,48 @@
</additionalProperties>
</configuration>
</execution>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${dockerfile-maven-plugin.version}</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
<execution>
<id>tag-latest</id>
<goals>
<goal>tag</goal>
</goals>
<configuration>
<tag>latest</tag>
</configuration>
</execution>
</executions>
<configuration>
<repository>nexus.terrestris.de/shogun/${project.artifactId}</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<skipDockerInfo>true</skipDockerInfo>
</configuration>
</plugin>
</plugins>
</pluginManagement>

Expand Down
6 changes: 6 additions & 0 deletions shogun-boot/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.iml
pom.xml
src
target
!target/classes/*.yml
!target/*.jar
7 changes: 7 additions & 0 deletions shogun-boot/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM openjdk:11-jdk-slim

COPY docker/docker-entrypoint.sh /
COPY target/classes/application.yml /config/application.yml
COPY target/shogun-boot-*.jar /opt/app.jar

ENTRYPOINT [ "/docker-entrypoint.sh" ]
10 changes: 10 additions & 0 deletions shogun-boot/docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e

if [ x"${JAVA_ENABLE_DEBUG}" != x ] && [ "${JAVA_ENABLE_DEBUG}" != "false" ]; then
JAVA_DEBUG_ARGS="-Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=${JAVA_DEBUG_PORT:-5005}"
fi

java $JAVA_DEBUG_ARGS -Djava.security.egd=file:/dev/./urandom -jar /opt/app.jar --spring.config.location=/config/application.yml
dnlkoch marked this conversation as resolved.
Show resolved Hide resolved

exec "$@"
17 changes: 5 additions & 12 deletions shogun-boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
<name>SHOGun Boot</name>
<packaging>jar</packaging>

<properties>
<!-- https://stackoverflow.com/questions/53609881/maven-multi-module-project-packaging-error -->
<spring-boot.repackage.skip>true</spring-boot.repackage.skip>
</properties>

<dependencies>

<!-- Spring Boot -->
Expand Down Expand Up @@ -130,19 +125,13 @@
<plugins>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<!-- TODO Version -->
<version>3.9.1</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.hibernate.orm.tooling</groupId>
Expand All @@ -167,6 +156,10 @@
<abbrevLength>8</abbrevLength>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down
6 changes: 6 additions & 0 deletions shogun-gs-interceptor/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.iml
pom.xml
src
target
!target/classes/*.yml
!target/*.jar
7 changes: 7 additions & 0 deletions shogun-gs-interceptor/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM openjdk:11-jdk-slim

COPY docker/docker-entrypoint.sh /
COPY target/classes/application.yml /config/application.yml
COPY target/shogun-gs-interceptor-*.jar /opt/app.jar

ENTRYPOINT [ "/docker-entrypoint.sh" ]
10 changes: 10 additions & 0 deletions shogun-gs-interceptor/docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e

if [ x"${JAVA_ENABLE_DEBUG}" != x ] && [ "${JAVA_ENABLE_DEBUG}" != "false" ]; then
JAVA_DEBUG_ARGS="-Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=${JAVA_DEBUG_PORT:-5005}"
dnlkoch marked this conversation as resolved.
Show resolved Hide resolved
fi

java $JAVA_DEBUG_ARGS -Djava.security.egd=file:/dev/./urandom -jar /opt/app.jar --spring.config.location=/config/application.yml

exec "$@"
16 changes: 4 additions & 12 deletions shogun-gs-interceptor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
<name>SHOGun GeoServer Interceptor</name>
<packaging>jar</packaging>

<properties>
<!-- https://stackoverflow.com/questions/53609881/maven-multi-module-project-packaging-error -->
<spring-boot.repackage.skip>true</spring-boot.repackage.skip>
</properties>

<dependencies>
<!-- Spring Boot -->
<dependency>
Expand Down Expand Up @@ -134,13 +129,6 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.hibernate.orm.tooling</groupId>
Expand All @@ -157,6 +145,10 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down