diff options
author | Pawel <pawel.kasperkiewicz@nokia.com> | 2020-02-10 13:03:38 +0100 |
---|---|---|
committer | Pawel <pawel.kasperkiewicz@nokia.com> | 2020-02-10 15:40:41 +0100 |
commit | 8b1072c09e60828433903d2e0cd1eaffaf8c4aa0 (patch) | |
tree | 532b29cb782a4bc47ff86509720b1e1de1df7e67 /certService | |
parent | 486429d47ff93e3aa6f9a012f98198cac69a4655 (diff) |
Add docker image building to maven configuration
Issue-ID: AAF-995
Signed-off-by: Pawel <pawel.kasperkiewicz@nokia.com>
Change-Id: I26862c9f2597ff058f869320ebd3948030b63051
Diffstat (limited to 'certService')
-rw-r--r-- | certService/README.md | 14 | ||||
-rw-r--r-- | certService/pom.xml | 56 |
2 files changed, 69 insertions, 1 deletions
diff --git a/certService/README.md b/certService/README.md index 431ff1df..908cfa29 100644 --- a/certService/README.md +++ b/certService/README.md @@ -19,11 +19,23 @@ ``` -### Building Docker image +### Building Docker image manually ``` docker build -t cert-service . ``` + +### Install the package into the local repository + ``` + mvn clean install + + ``` + +### Building Docker image and install the package into the local repository + ``` + mvn clean install -P docker + + ``` ### Running Docker container ``` diff --git a/certService/pom.xml b/certService/pom.xml index b3b83deb..8402d749 100644 --- a/certService/pom.xml +++ b/certService/pom.xml @@ -38,6 +38,7 @@ <spring-boot-starter-actuator.version>2.2.4.RELEASE</spring-boot-starter-actuator.version> <spring-boot-starter-log4j2.version>2.1.5.RELEASE</spring-boot-starter-log4j2.version> <springdoc-openapi-ui.version>1.2.21</springdoc-openapi-ui.version> + <docker-maven-plugin.version>0.33.0</docker-maven-plugin.version> </properties> <dependencyManagement> @@ -144,6 +145,7 @@ <quiet>true</quiet> <verbose>false</verbose> <useStandardDocletOptions>false</useStandardDocletOptions> + <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable> </configuration> <executions> <execution> @@ -164,4 +166,58 @@ </plugins> </build> + <profiles> + <profile> + <id>docker</id> + <activation> + <activeByDefault>false</activeByDefault> + </activation> + <build> + <plugins> + <plugin> + <groupId>io.fabric8</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>${docker-maven-plugin.version}</version> + <executions> + <execution> + <id>start</id> + <phase>pre-integration-test</phase> + <goals> + <goal>build</goal> + <goal>start</goal> + </goals> + </execution> + <execution> + <id>stop</id> + <phase>post-integration-test</phase> + <goals> + <goal>stop</goal> + </goals> + </execution> + </executions> + <configuration> + <images> + <image> + <name>cert-service</name> + <build> + <dockerFile>${project.basedir}/Dockerfile</dockerFile > + </build> + <run> + <ports> + <port>8080:8080</port> + </ports> + <wait> + <!-- Check for this URL to return a 200 return code .... --> + <url>http://localhost:8080/actuator/health</url> + <time>120000</time> + </wait> + </run> + </image> + </images> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> </project> |