Skip to content

Commit

Permalink
set version; added docker plugin for pushing image
Browse files Browse the repository at this point in the history
  • Loading branch information
szerhusenBC committed Sep 10, 2019
1 parent c06db14 commit 76a6819
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
39 changes: 38 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.zerhusen</groupId>
<artifactId>jwtdemo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>2.0.0</version>
<packaging>jar</packaging>

<name>jwtdemo</name>
Expand All @@ -23,6 +23,8 @@
<java.version>11</java.version>

<jjwt.version>0.10.6</jjwt.version>

<dockerfile-maven-plugin.version>1.4.12</dockerfile-maven-plugin.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -87,4 +89,39 @@
</plugins>
</build>

<profiles>
<profile>
<id>build-docker</id>
<build>
<plugins>
<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>
<!-- I don't have deployment -->
<phase>pre-integration-test</phase>
</execution>
</executions>
<configuration>
<dockerfile>${project.basedir}/src/main/docker/Dockerfile</dockerfile>
<repository>hubae/jwt-spring-security-demo</repository>
<tag>${project.version}</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
8 changes: 8 additions & 0 deletions src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM adoptopenjdk/openjdk11:alpine
MAINTAINER Stephan Zerhusen <strephan.zerhusen@gmail.com>

# Add the service itself
ARG JAR_FILE
ADD target/${JAR_FILE} /usr/share/jwt-spring-security-demo.jar

ENTRYPOINT ["java", "-jar", "/usr/share/jwt-spring-security-demo.jar"]

0 comments on commit 76a6819

Please sign in to comment.