summaryrefslogtreecommitdiffstats
path: root/mod2/auth-service
diff options
context:
space:
mode:
authorDhrumin Desai <dd303q@att.com>2020-09-28 09:02:07 -0400
committerVijay Venkatesh Kumar <vv770d@att.com>2020-09-29 16:05:08 +0000
commitf51b3e1a957ede6c263d0c3634f36c7fcfbb95ff (patch)
treeb1dcc46870d1c0fb2840d354dfe204a05bdf4460 /mod2/auth-service
parentab2a4fbd5f0c08db1acd4710fb9a71a03cef6066 (diff)
updating docker repository to onap nexus
Change-Id: Id01bca24cad873742012f46fce8c02eba6e56d7d Issue-ID: DCAEGEN2-2317 Signed-off-by: Dhrumin Desai <dd303q@att.com> Signed-off-by: Mantena, Ravi (rx908f) <rx908f@att.com> Signed-off-by: Ravi Mantena <rx908f@att.com>
Diffstat (limited to 'mod2/auth-service')
-rw-r--r--mod2/auth-service/Dockerfile5
-rw-r--r--mod2/auth-service/pom.xml65
2 files changed, 62 insertions, 8 deletions
diff --git a/mod2/auth-service/Dockerfile b/mod2/auth-service/Dockerfile
index c427bda..aa8707f 100644
--- a/mod2/auth-service/Dockerfile
+++ b/mod2/auth-service/Dockerfile
@@ -2,10 +2,13 @@ FROM onap/integration-java11:7.1.0
WORKDIR /usr/app
VOLUME /tmp
-ADD target/auth-service-1.0.0-SNAPSHOT.jar auth-service-1.0.0-SNAPSHOT.jar
+ARG PROJECT_BUILD_DIR_NAME
+ARG FINAL_JAR
EXPOSE 8082
+COPY ${PROJECT_BUILD_DIR_NAME}/${FINAL_JAR} .
+
ENTRYPOINT ["java", \
"-Djava.security.egd=file:/dev/./urandom", \
"-jar", "auth-service-1.0.0-SNAPSHOT.jar"] \ No newline at end of file
diff --git a/mod2/auth-service/pom.xml b/mod2/auth-service/pom.xml
index 1fd4f02..75782f4 100644
--- a/mod2/auth-service/pom.xml
+++ b/mod2/auth-service/pom.xml
@@ -39,6 +39,8 @@
<java.version>11</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
+ <dockerfile-maven-plugin.version>1.4.10</dockerfile-maven-plugin.version>
+ <docker.image.name>${project.groupId}.${project.artifactId}</docker.image.name>
</properties>
<dependencies>
@@ -125,13 +127,13 @@
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>RELEASE</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
<dependencyManagement>
<dependencies>
@@ -162,10 +164,59 @@
</executions>
</plugin>
<plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>dockerfile-maven-plugin</artifactId>
+ <version>${dockerfile-maven-plugin.version}</version>
+ <configuration>
+ <contextDirectory>${project.basedir}</contextDirectory>
+ <repository>${onap.nexus.dockerregistry.daily}/${docker.image.name}</repository>
+ <buildArgs>
+ <PROJECT_BUILD_DIR_NAME>target</PROJECT_BUILD_DIR_NAME>
+ <FINAL_JAR>${project.build.finalName}.jar</FINAL_JAR>
+ </buildArgs>
+ </configuration>
+ <executions>
+ <execution>
+ <id>build-image</id>
+ <phase>package</phase>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>tag-and-push-image-latest</id>
+ <phase>package</phase>
+ <goals>
+ <goal>tag</goal>
+ <goal>push</goal>
+ </goals>
+ <configuration>
+ <repository>${onap.nexus.dockerregistry.daily}/${docker.image.name}</repository>
+ <tag>latest</tag>
+ <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
+ </configuration>
+ </execution>
+ <execution>
+ <id>tag-and-push-image-with-version</id>
+ <phase>package</phase>
+ <goals>
+ <goal>tag</goal>
+ <goal>push</goal>
+ </goals>
+ <configuration>
+ <repository>${onap.nexus.dockerregistry.daily}/${docker.image.name}</repository>
+ <tag>${project.version}</tag>
+ <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
</plugins>
+ <finalName>mod-auth-service</finalName>
</build>
</project>