Repository: isis Updated Branches: refs/heads/maint-1.13.3 7c2ca9933 -> e2f0a9f58
ISIS-1558: extends the simpleapp to use spotify maven plugin directly Project: http://git-wip-us.apache.org/repos/asf/isis/repo Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/0febb58e Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/0febb58e Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/0febb58e Branch: refs/heads/maint-1.13.3 Commit: 0febb58e932e57eee1ef4a3829bb3cf98952791a Parents: 7c2ca99 Author: Dan Haywood <d...@haywood-associates.co.uk> Authored: Thu Dec 22 14:16:32 2016 +0000 Committer: Dan Haywood <d...@haywood-associates.co.uk> Committed: Thu Dec 22 14:16:32 2016 +0000 ---------------------------------------------------------------------- example/application/simpleapp/pom.xml | 12 +++ example/application/simpleapp/webapp/pom.xml | 79 +++++++++++++++++++- .../webapp/src/main/resources/docker/Dockerfile | 5 ++ 3 files changed, 93 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/isis/blob/0febb58e/example/application/simpleapp/pom.xml ---------------------------------------------------------------------- diff --git a/example/application/simpleapp/pom.xml b/example/application/simpleapp/pom.xml index 56707d1..0616fa7 100644 --- a/example/application/simpleapp/pom.xml +++ b/example/application/simpleapp/pom.xml @@ -89,6 +89,10 @@ <jdepend-maven-plugin.version>2.0-beta-2</jdepend-maven-plugin.version> <findbugs-maven-plugin.version>2.5</findbugs-maven-plugin.version> + <mavenmixin-docker.version>0.0.1-SNAPSHOT</mavenmixin-docker.version> + <maven-deploy-plugin.version>2.8.1</maven-deploy-plugin.version> + <docker-maven-plugin.version>0.4.13</docker-maven-plugin.version> + <mavendeps-isistesting.version>0.0.2</mavendeps-isistesting.version> <mavendeps-isisintellij.version>0.0.1</mavendeps-isisintellij.version> <mavendeps-isiswebapp.version>0.0.1</mavendeps-isiswebapp.version> @@ -233,6 +237,14 @@ <artifactId>findbugs-maven-plugin</artifactId> <version>${findbugs-maven-plugin.version}</version> </plugin> + + <!-- mavenmixin-docker --> + <plugin> + <groupId>com.spotify</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>${docker-maven-plugin.version}</version> + </plugin> + </plugins> </pluginManagement> <plugins> http://git-wip-us.apache.org/repos/asf/isis/blob/0febb58e/example/application/simpleapp/webapp/pom.xml ---------------------------------------------------------------------- diff --git a/example/application/simpleapp/webapp/pom.xml b/example/application/simpleapp/webapp/pom.xml index 96b22a5..41d77bb 100644 --- a/example/application/simpleapp/webapp/pom.xml +++ b/example/application/simpleapp/webapp/pom.xml @@ -42,12 +42,19 @@ <jetty-console-maven-plugin.backgroundImage>${basedir}/src/main/jettyconsole/isis-banner.png</jetty-console-maven-plugin.backgroundImage> <maven-war-plugin.warName>${project.parent.artifactId}</maven-war-plugin.warName> + + <docker-plugin.imageName>danhaywood/isis-app-simpleapp</docker-plugin.imageName> + <docker-plugin.resource.include>${maven-war-plugin.warName}.war</docker-plugin.resource.include> + <docker-plugin.maintainer>Apache Isis committers</docker-plugin.maintainer> + <docker-plugin.serverId>docker-hub</docker-plugin.serverId> + <docker-plugin.registryUrl>https://index.docker.io/v1/</docker-plugin.registryUrl> + </properties> <build> <resources> <resource> - <filtering>false</filtering> + <filtering>true</filtering> <directory>src/main/resources</directory> </resource> <resource> @@ -88,6 +95,7 @@ </execution> </executions> </plugin> + <plugin> <groupId>com.github.odavid.maven.plugins</groupId> <artifactId>mixin-maven-plugin</artifactId> @@ -123,6 +131,73 @@ </mixins> </configuration> </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <plugin> + <groupId>com.spotify</groupId> + <artifactId>docker-maven-plugin</artifactId> + <executions> + <execution> + <id>build-image</id> + <phase>package</phase> + <goals> + <goal>build</goal> + </goals> + </execution> + <execution> + <id>tag-image</id> + <phase>install</phase> + <goals> + <goal>tag</goal> + </goals> + <configuration> + <image>${docker-plugin.imageName}</image> + <newName>${docker-plugin.imageName}:${project.version}</newName> + </configuration> + </execution> + <execution> + <id>push-image</id> + <phase>deploy</phase> + <goals> + <goal>push</goal> + </goals> + <configuration> + <imageName>${docker-plugin.imageName}:${project.version}</imageName> + </configuration> + </execution> + <execution> + <id>push-image-latest</id> + <phase>deploy</phase> + <goals> + <goal>push</goal> + </goals> + <configuration> + <imageName>${docker-plugin.imageName}:latest</imageName> + </configuration> + </execution> + </executions> + <configuration> + <imageName>${docker-plugin.imageName}</imageName> + <dockerDirectory>${build.outputDirectory}/docker</dockerDirectory> + <resources> + <resource> + <targetPath>.</targetPath> + <directory>${project.build.directory}</directory> + <include>${docker-plugin.resource.include}</include> + </resource> + </resources> + <serverId>${docker-plugin.serverId}</serverId> + <registryUrl>${docker-plugin.registryUrl}</registryUrl> + </configuration> + </plugin> + + </plugins> </build> @@ -186,7 +261,6 @@ </dependency> </dependencies> </profile> - <!-- <profile> <id>jdbc-postgres</id> <activation> @@ -202,7 +276,6 @@ </dependency> </dependencies> </profile> - --> <!-- <profile> <id>jdbc-mssql</id> http://git-wip-us.apache.org/repos/asf/isis/blob/0febb58e/example/application/simpleapp/webapp/src/main/resources/docker/Dockerfile ---------------------------------------------------------------------- diff --git a/example/application/simpleapp/webapp/src/main/resources/docker/Dockerfile b/example/application/simpleapp/webapp/src/main/resources/docker/Dockerfile new file mode 100644 index 0000000..eb975db --- /dev/null +++ b/example/application/simpleapp/webapp/src/main/resources/docker/Dockerfile @@ -0,0 +1,5 @@ +FROM incodehq/tomcat +MAINTAINER ${docker-plugin.maintainer} +RUN rm -rf ${DEPLOYMENT_DIR}/ROOT +COPY ${docker-plugin.resource.include} ${DEPLOYMENT_DIR}/ROOT.war +EXPOSE 8080 \ No newline at end of file