Create Docker Image 39/59939/7
authorPrudence Au <prudence.au@amdocs.com>
Fri, 10 Aug 2018 00:28:12 +0000 (20:28 -0400)
committerPrudence Au <prudence.au@amdocs.com>
Fri, 10 Aug 2018 01:37:59 +0000 (21:37 -0400)
Change-Id: I94f5b534eb75f2dfaeecb52bd36931926f0923cf
Issue-ID: LOG-519
Signed-off-by: Prudence Au <prudence.au@amdocs.com>
pom.xml
src/main/docker/Dockerfile

diff --git a/pom.xml b/pom.xml
index 979afec..54e8e17 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                <java.version>1.8</java.version>
                <dmaap.client.version>1.1.5</dmaap.client.version>
                <aai.rest.client.version>1.2.1</aai.rest.client.version>
+               <!--docker-->
+        <docker.tag>${project.version}-${timestamp}</docker.tag>
+        <docker.latest.tag>${project.version}-latest</docker.latest.tag>
+        <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
+        <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
        </properties>
 
        <dependencyManagement>
                                        </execution>
                                </executions>
                        </plugin>
-                       <plugin>
+                       <!--<plugin>
                                <groupId>com.spotify</groupId>
                                <artifactId>docker-maven-plugin</artifactId>
                                <version>0.4.11</version>
                                        </imageTags>
                                        <forceTags>true</forceTags>
                                </configuration>
-                       </plugin>
+                       </plugin>-->
                        <plugin>
                                <groupId>org.springframework.boot</groupId>
                                <artifactId>spring-boot-maven-plugin</artifactId>
                        </resource>
                </resources>
        </build>
+
+       <profiles>
+               <profile>
+                       <id>docker</id>
+                       <build>
+                       <plugins>
+                               <plugin>
+            <groupId>io.fabric8</groupId>
+            <artifactId>docker-maven-plugin</artifactId>
+            <version>0.19.1</version>
+            <configuration>
+                <verbose>true</verbose>
+                <apiVersion>1.23</apiVersion>
+                <pullRegistry>${docker.pull.registry}</pullRegistry>
+                <pushRegistry>${docker.push.registry}</pushRegistry>
+                <dockerHost>${docker.pull.registry}</dockerHost>
+                <images>
+                    <image>
+                        <name>onap/${project.artifactId}</name>
+                        <alias>${project.artifactId}</alias>
+                        <build>
+                            <cleanup>true</cleanup>
+                            <tags>
+                                <tag>${docker.snapshot.tag}</tag>
+                                <tag>${docker.latest.tag}</tag>
+                            </tags>
+                            <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
+                        </build>
+                    </image>
+                </images>
+            </configuration>
+            <executions>
+                <execution>
+                    <id>clean-images</id>
+                    <phase>pre-clean</phase>
+                    <goals>
+                        <goal>remove</goal>
+                    </goals>
+                    <configuration>
+                        <removeAll>true</removeAll>
+                    </configuration>
+                </execution>
+
+                <execution>
+                    <id>generate-images</id>
+                    <phase>package</phase>
+                    <goals>
+                        <goal>build</goal>
+                    </goals>
+                </execution>
+                <execution>
+                    <id>push-images</id>
+                    <phase>deploy</phase>
+                    <goals>
+                        <goal>build</goal>
+                        <goal>push</goal>
+                    </goals>
+                    <configuration>
+                        <image>onap/vvp/cms</image>
+                    </configuration>
+                </execution>
+            </executions>
+        </plugin>
+        </plugins>
+        </build>
+        </profile>
+       </profiles>
 </project>
\ No newline at end of file
index 0cdd1cf..a764fbf 100644 (file)
@@ -8,12 +8,12 @@ RUN mkdir -p $MICROSERVICE_HOME/config/
 RUN mkdir -p $MICROSERVICE_HOME/lib/
 RUN mkdir -p $MICROSERVICE_HOME/bin/
 
-ADD target/pomba-context-aggregator.jar $MICROSERVICE_HOME/lib/
-COPY config/ $MICROSERVICE_HOME/config/
-ADD target/startService.sh $MICROSERVICE_HOME/bin/
+#ADD ./target/pomba-context-aggregator.jar $MICROSERVICE_HOME/lib/
+#COPY ./config/ $MICROSERVICE_HOME/config/
+#ADD ./target/startService.sh $MICROSERVICE_HOME/bin/
 
-RUN chmod 755 $MICROSERVICE_HOME/config/*
-RUN chmod 755 $MICROSERVICE_HOME/lib/*
-RUN chmod 755 $MICROSERVICE_HOME/bin/*
+#RUN chmod 755 $MICROSERVICE_HOME/config/*
+#RUN chmod 755 $MICROSERVICE_HOME/lib/*
+#RUN chmod 755 $MICROSERVICE_HOME/bin/*
 
 CMD ["/opt/app/bin/startServer.sh"]