Control docker build with profile

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>
diff --git a/ms/controllerblueprints/.gitignore b/ms/controllerblueprints/.gitignore
index 644e3b4..8cda363 100644
--- a/ms/controllerblueprints/.gitignore
+++ b/ms/controllerblueprints/.gitignore
@@ -20,4 +20,5 @@
 

 **/*versionsBackup

 **/blackDuckHub*

-**/*.jsonld
\ No newline at end of file
+**/*.jsonld
+/target-ide/
diff --git a/ms/controllerblueprints/application/pom.xml b/ms/controllerblueprints/application/pom.xml
index 38f81c1..24f4deb 100644
--- a/ms/controllerblueprints/application/pom.xml
+++ b/ms/controllerblueprints/application/pom.xml
@@ -198,5 +198,7 @@
             </plugin>

         </plugins>

     </build>

+    

+    

 </project>

 

diff --git a/ms/controllerblueprints/distribution/pom.xml b/ms/controllerblueprints/distribution/pom.xml
index 37c0b84..7a2c679 100644
--- a/ms/controllerblueprints/distribution/pom.xml
+++ b/ms/controllerblueprints/distribution/pom.xml
@@ -34,7 +34,10 @@
         <name.space>org.onap.ccsdk.apps</name.space>     <!-- <name.space>${namespace}</name.space> -->

         <serviceArtifactName>controllerblueprints</serviceArtifactName>

         <image.name>onap/ccsdk-controllerblueprints</image.name>

-    </properties>

+		<docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>

+		<docker.push.phase>deploy</docker.push.phase>

+		<docker.verbose>true</docker.verbose>

+	</properties>

 

     <dependencies>

         <dependency>

@@ -141,47 +144,52 @@
                     </execution>

                 </executions>

             </plugin>

-            <plugin>

-                <groupId>io.fabric8</groupId>

-                <artifactId>docker-maven-plugin</artifactId>

-                <version>0.26.1</version>

-                <inherited>false</inherited>

-                <configuration>

-                    <images>

-                        <image>

-                            <name>${image.name}</name>

-                            <build>

-                                <cleanup>try</cleanup>

-                                <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>

-                                <tags>

-                                    <tag>${project.version}</tag>

-                                    <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>

-                                    <tag>${project.docker.latesttag.version}</tag>

-                                </tags>

-                            </build>

-                        </image>

-                    </images>

-                    <verbose>true</verbose>

-                </configuration>

-                <executions>

-                    <!--<execution>-->

-                        <!--<id>build-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>

-                    </execution>

-                </executions>

-            </plugin>

+

         </plugins>

     </build>

+

+	<profiles>

+		<profile>

+			<id>docker</id>

+			<build>

+				<plugins>

+					<plugin>

+						<groupId>io.fabric8</groupId>

+						<artifactId>docker-maven-plugin</artifactId>

+						<version>0.26.1</version>

+						<inherited>false</inherited>

+						<configuration>

+							<images>

+								<image>

+									<name>${image.name}</name>

+									<build>

+										<cleanup>try</cleanup>

+										<dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>

+										<tags>

+											<tag>${project.version}</tag>

+											<tag>${project.version}-STAGING-${maven.build.timestamp}</tag>

+											<tag>${project.docker.latesttag.version}</tag>

+										</tags>

+									</build>

+								</image>

+							</images>

+							<verbose>true</verbose>

+						</configuration>

+						<executions>

+							<execution>

+								<id>push-images</id>

+								<phase>${docker.build.phase}</phase>

+								<goals>

+									<goal>build</goal>

+									<goal>push</goal>

+								</goals>

+							</execution>

+						</executions>

+					</plugin>

+				</plugins>

+			</build>

+		</profile>

+

+	</profiles>

 </project>