update docker image tags 42/78442/1
authorsunil unnava <sunil.unnava@att.com>
Wed, 13 Feb 2019 22:45:31 +0000 (17:45 -0500)
committersunil unnava <sunil.unnava@att.com>
Wed, 13 Feb 2019 22:47:06 +0000 (17:47 -0500)
Issue-ID: DMAAP-1042
Change-Id: Ia2fa750cb7507e6615a61ed3d7fe872709140939
Signed-off-by: sunil unnava <sunil.unnava@att.com>
pom.xml
version.properties

diff --git a/pom.xml b/pom.xml
index 14d8064..582dd27 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
 
        <groupId>org.onap.dmaap.zookeeper</groupId>
        <artifactId>zookeepr</artifactId>
-       <version>2.0.0-SNAPSHOT</version>
+       <version>3.0.0-SNAPSHOT</version>
        <name>zookeeper</name>
        <licenses>
                <license>
                                        <dockerDirectory>src/main/docker</dockerDirectory>
                                        <serverId>docker-hub</serverId>
                                        <imageTags>
-                                               <imageTag>${zookeeperImg}</imageTag>
-                                               <imageTag>latest</imageTag>
+                                               <imageTag>${dockertag1}</imageTag>
+                                               <imageTag>${dockertag2}</imageTag>
                                        </imageTags>
                                        <forceTags>true</forceTags>
                                        <resources>
                                                </goals>
                                                <configuration>
                                                        <image>onap/dmaap/zookeeper</image>
-                                                       <newName>${docker.push.registry}/onap/dmaap/zookeeper:${zookeeperImg}</newName>
+                                                       <newName>${docker.push.registry}/onap/dmaap/zookeeper:${dockertag2}}</newName>
                                                        <skipDockerTag>${skip.docker.push}</skipDockerTag>
                                                </configuration>
                                        </execution>
                                                </goals>
                                                <configuration>
                                                        <image>onap/dmaap/zookeeper</image>
-                                                       <newName>${docker.push.registry}/onap/dmaap/zookeeper:latest</newName>
+                                                       <newName>${docker.push.registry}/onap/dmaap/zookeeper:${dockertag1}</newName>
                                                        <skipDockerTag>${skip.docker.push}</skipDockerTag>
                                                </configuration>
                                        </execution>
                                                        <goal>push</goal>
                                                </goals>
                                                <configuration>
-                                                       <imageName>${docker.push.registry}/onap/dmaap/zookeeper:${zookeeperImg}</imageName>
+                                                       <imageName>${docker.push.registry}/onap/dmaap/zookeeper:${dockertag2}</imageName>
                                                        <skipDockerPush>${skip.docker.push}</skipDockerPush>
                                                </configuration>
                                        </execution>
                                                        <goal>push</goal>
                                                </goals>
                                                <configuration>
-                                                       <imageName>${docker.push.registry}/onap/dmaap/zookeeper:latest</imageName>
+                                                       <imageName>${docker.push.registry}/onap/dmaap/zookeeper:${dockertag1}</imageName>
                                                        <skipDockerPush>${skip.docker.push}</skipDockerPush>
                                                </configuration>
                                        </execution>
 
        <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-               <zookeeperImg>2.0.0</zookeeperImg>
+               <timestamp>${maven.build.timestamp}</timestamp>
+        <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
                <sitePath>/content/sites/site/org/onap/dmaap/zookeeper/${project.artifactId}/${project.version}</sitePath>
                <skip.docker.build>true</skip.docker.build>
                <skip.docker.push>true</skip.docker.push>
                                <skip.docker.tag>false</skip.docker.tag>
                                <skip.docker.push>false</skip.docker.push>
                        </properties>
+                  <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']=project.properties['ver'] + "-" + project.properties['timestamp'];
+                                        } 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>
+                    </plugins>
+                    </build>
                </profile>
 
        </profiles>
index 94925e5..b24f719 100644 (file)
@@ -24,7 +24,7 @@
 # Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... )
 # because they are used in Jenkins, whose plug-in doesn't support
 
-major=2
+major=3
 minor=0
 patch=0