Correcting jenkins build errors and docker tags 83/3783/1 release-1.0.0
authorPatrick Brady <pb071s@att.com>
Mon, 1 May 2017 19:15:37 +0000 (12:15 -0700)
committerPatrick Brady <pb071s@att.com>
Mon, 1 May 2017 19:15:45 +0000 (12:15 -0700)
Change-Id: I55faadad61dc78e069443ea859a83409758e2b9b
Signed-off-by: Patrick Brady <pb071s@att.com>
installation/appc/pom.xml
pom.xml

index 317273d..e46f1d7 100644 (file)
                        <id>docker</id>
                        <build>
                                <plugins>
+                                       <plugin>
+                                               <groupId>org.codehaus.groovy.maven</groupId>
+                                               <artifactId>gmaven-plugin</artifactId>
+                                               <executions>
+                                                       <execution>
+                                                               <phase>validate</phase>
+                                                               <goals>
+                                                                       <goal>execute</goal>
+                                                               </goals>
+                                                               <configuration>
+                                                                       <properties>
+                                                                               <ver>${project.version}</ver>
+                                                                               <timestamp>${maven.build.timestamp}</timestamp>
+                                                                       </properties>
+                                                                       <source>
+                                                                               println project.properties['ver'];
+                                                                               def versionArray;
+                                                                               if ( project.properties['ver'] != null ) {
+                                                                               versionArray = project.properties['ver'].split('\\.');
+                                                                               }
+                                                                               if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
+                                                                               project.properties['dockertag1']=project.properties['ver'] + "-latest";
+                                                                               project.properties['dockertag2']="latest";
+                                                                               } else {
+                                                                               project.properties['dockertag1']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
+                                                                               project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
+                                                                               }
+                                                                               println 'docker tag 1: ' + project.properties['dockertag1'];
+                                                                               println 'docker tag 2: ' + project.properties['dockertag2'];
+                                                                       </source>
+                                                               </configuration>
+                                                       </execution>
+                                               </executions>
+                                       </plugin>
                                        <plugin>
                                                <groupId>io.fabric8</groupId>
                                                <artifactId>docker-maven-plugin</artifactId>
                                                                                <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
                                                                                <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
                                                                                <tags>
-                                                                                       <!-- <tag>${appc.docker.staging.version}-STAGING-${maven.build.timestamp}</tag> -->
-                                                                                       <tag>${release_name}.${sprint_number}-STAGING-latest</tag>
+                                                                                       <tag>${dockertag1}</tag>
                                                                                </tags>
                                                                        </build>
                                                                </image>
diff --git a/pom.xml b/pom.xml
index 83a73fb..ac6e44b 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     <name>APPC Docker Project</name>
     <description>The APP-C component contains SDNC Docker Image, and installs APPC/SDNC components on top.</description>
 
+    <properties>
+        <!-- NEXUS URLS -->
+        <openecomp.nexus.host>nexus.onap.org</openecomp.nexus.host>
+        <openecomp.nexus.url>https://${openecomp.nexus.host}/content</openecomp.nexus.url>
+        <openecomp.nexus.snapshot-url>${openecomp.nexus.url}/repositories/snapshots/</openecomp.nexus.snapshot-url>
+        <openecomp.nexus.release-url>${openecomp.nexus.url}/repositories/releases/</openecomp.nexus.release-url>
+    </properties>
+
     <!-- ================================================================================== -->
     <!-- Define plugin repositories -->
     <!-- ================================================================================== -->
@@ -44,7 +52,7 @@
                     <version>1.6.7</version>
                     <extensions>true</extensions>
                     <configuration>
-                        <nexusUrl>https://nexus.openecomp.org</nexusUrl>
+                        <nexusUrl>https://${openecomp.nexus.host}</nexusUrl>
                         <stagingProfileId>176c31dfe190a</stagingProfileId>
                         <serverId>ecomp-staging</serverId>
                     </configuration>