Control docker build with profile
authorTimoney, Dan (dt5972) <dt5972@att.com>
Wed, 12 Sep 2018 19:31:10 +0000 (15:31 -0400)
committerDan Timoney <dt5972@att.com>
Thu, 13 Sep 2018 15:04:11 +0000 (15:04 +0000)
Docker build should only be run if docker profile is enabled.

Change-Id: I6942c3e59b769053fd47d04fe98f3e4b95ea33dd
Issue-ID: CCSDK-558
Signed-off-by: Timoney, Dan (dt5972) <dt5972@att.com>
ms/controllerblueprints/.gitignore
ms/controllerblueprints/application/pom.xml
ms/controllerblueprints/distribution/pom.xml

index 644e3b4..8cda363 100644 (file)
@@ -20,4 +20,5 @@
 \r
 **/*versionsBackup\r
 **/blackDuckHub*\r
-**/*.jsonld
\ No newline at end of file
+**/*.jsonld
+/target-ide/
index 38f81c1..24f4deb 100644 (file)
             </plugin>\r
         </plugins>\r
     </build>\r
+    \r
+    \r
 </project>\r
 \r
index 37c0b84..7a2c679 100644 (file)
         <name.space>org.onap.ccsdk.apps</name.space>     <!-- <name.space>${namespace}</name.space> -->\r
         <serviceArtifactName>controllerblueprints</serviceArtifactName>\r
         <image.name>onap/ccsdk-controllerblueprints</image.name>\r
-    </properties>\r
+               <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>\r
+               <docker.push.phase>deploy</docker.push.phase>\r
+               <docker.verbose>true</docker.verbose>\r
+       </properties>\r
 \r
     <dependencies>\r
         <dependency>\r
                     </execution>\r
                 </executions>\r
             </plugin>\r
-            <plugin>\r
-                <groupId>io.fabric8</groupId>\r
-                <artifactId>docker-maven-plugin</artifactId>\r
-                <version>0.26.1</version>\r
-                <inherited>false</inherited>\r
-                <configuration>\r
-                    <images>\r
-                        <image>\r
-                            <name>${image.name}</name>\r
-                            <build>\r
-                                <cleanup>try</cleanup>\r
-                                <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>\r
-                                <tags>\r
-                                    <tag>${project.version}</tag>\r
-                                    <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>\r
-                                    <tag>${project.docker.latesttag.version}</tag>\r
-                                </tags>\r
-                            </build>\r
-                        </image>\r
-                    </images>\r
-                    <verbose>true</verbose>\r
-                </configuration>\r
-                <executions>\r
-                    <!--<execution>-->\r
-                        <!--<id>build-images</id>-->\r
-                        <!--<phase>package</phase>-->\r
-                        <!--<goals>-->\r
-                            <!--<goal>build</goal>-->\r
-                        <!--</goals>-->\r
-                    <!--</execution>-->\r
-                    <execution>\r
-                        <id>push-images</id>\r
-                        <phase>deploy</phase>\r
-                        <goals>\r
-                            <goal>build</goal>\r
-                            <goal>push</goal>\r
-                        </goals>\r
-                    </execution>\r
-                </executions>\r
-            </plugin>\r
+\r
         </plugins>\r
     </build>\r
+\r
+       <profiles>\r
+               <profile>\r
+                       <id>docker</id>\r
+                       <build>\r
+                               <plugins>\r
+                                       <plugin>\r
+                                               <groupId>io.fabric8</groupId>\r
+                                               <artifactId>docker-maven-plugin</artifactId>\r
+                                               <version>0.26.1</version>\r
+                                               <inherited>false</inherited>\r
+                                               <configuration>\r
+                                                       <images>\r
+                                                               <image>\r
+                                                                       <name>${image.name}</name>\r
+                                                                       <build>\r
+                                                                               <cleanup>try</cleanup>\r
+                                                                               <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>\r
+                                                                               <tags>\r
+                                                                                       <tag>${project.version}</tag>\r
+                                                                                       <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>\r
+                                                                                       <tag>${project.docker.latesttag.version}</tag>\r
+                                                                               </tags>\r
+                                                                       </build>\r
+                                                               </image>\r
+                                                       </images>\r
+                                                       <verbose>true</verbose>\r
+                                               </configuration>\r
+                                               <executions>\r
+                                                       <execution>\r
+                                                               <id>push-images</id>\r
+                                                               <phase>${docker.build.phase}</phase>\r
+                                                               <goals>\r
+                                                                       <goal>build</goal>\r
+                                                                       <goal>push</goal>\r
+                                                               </goals>\r
+                                                       </execution>\r
+                                               </executions>\r
+                                       </plugin>\r
+                               </plugins>\r
+                       </build>\r
+               </profile>\r
+\r
+       </profiles>\r
 </project>\r
 \r