Skip to content

Commit

Permalink
build docker image with spotify maven docker plugin and travis-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
krzyzy-hltech committed Jul 30, 2018
1 parent 4c9a527 commit c8fa5c3
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 34 deletions.
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@ cache:
directories:
- $HOME/.m2

script: "mvn clean verify jacoco:report coveralls:report"
jobs:
include:
- stage: build with maven & generate reporrts
script:
- mvn clean verify jacoco:report coveralls:report
- stage: build & publish docker image for server
script:
- mvn docker:build@build-docker -P docker-app
33 changes: 0 additions & 33 deletions judge-d-server/Dockerfile

This file was deleted.

10 changes: 10 additions & 0 deletions judge-d-server/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM openjdk:8-jdk-alpine



WORKDIR /root
ADD ./judge-d-server-0.1-SNAPSHOT.jar /root/judge-d.jar
ADD ./entrypoint.sh /root/entrypoint.sh
RUN chmod +x /root/entrypoint.sh

ENTRYPOINT ["/root/entrypoint.sh"]
File renamed without changes.
35 changes: 35 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,39 @@
</plugins>
</pluginManagement>
</build>

<profiles>
<profile>
<id>docker-app</id>
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>build-docker</id>
<goals>
<goal>build</goal>
</goals>
<configuration>
<imageName>hltech/judge-d</imageName>
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>

<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit c8fa5c3

Please sign in to comment.