update docker image tags 41/78441/1
authorsunil unnava <sunil.unnava@att.com>
Wed, 13 Feb 2019 22:40:39 +0000 (17:40 -0500)
committersunil unnava <sunil.unnava@att.com>
Wed, 13 Feb 2019 22:41:19 +0000 (17:41 -0500)
Issue-ID: DMAAP-1042
Change-Id: If2e828087f84573d27cebfe37c626739e77d7a19
Signed-off-by: sunil unnava <sunil.unnava@att.com>
pom.xml
version.properties

diff --git a/pom.xml b/pom.xml
index e47c8c0..59084ae 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
 
        <groupId>org.onap.dmaap.kafka</groupId>
        <artifactId>kafka11aaf</artifactId>
-       <version>0.0.3-SNAPSHOT</version>
+       <version>0.0.4-SNAPSHOT</version>
        <name>dmaap-kafka11aaf</name>
        <licenses>
                <license>
                                        <dockerDirectory>src/main/docker</dockerDirectory>
                                        <serverId>docker-hub</serverId>
                                        <imageTags>
-                                               <imageTag>${KafkaImg}</imageTag>
-                                               <imageTag>latest</imageTag>
+                                               <imageTag>${dockertag1}</imageTag>
+                                               <imageTag>${dockertag2}</imageTag>
                                        </imageTags>
-                                       <forceTags>true</forceTags>
                                        <resources>
                                                <!-- <resource> <targetPath>/</targetPath> <directory>${dockerLocation}</directory> 
                                                        <include>${project.build.finalName}.jar</include> </resource> -->
                                                </goals>
                                                <configuration>
                                                        <image>onap/dmaap/kafka01101</image>
-                                                       <newName>${docker.push.registry}/onap/dmaap/kafka01101:${KafkaImg}</newName>
+                                                       <newName>${docker.push.registry}/onap/dmaap/kafka01101:${dockertag2}</newName>
                                                        <skipDockerTag>${skip.docker.push}</skipDockerTag>
                                                </configuration>
                                        </execution>
                                                </goals>
                                                <configuration>
                                                        <image>onap/dmaap/kafka01101</image>
-                                                       <newName>${docker.push.registry}/onap/dmaap/kafka01101:latest</newName>
+                                                       <newName>${docker.push.registry}/onap/dmaap/kafka01101:${dockertag1}</newName>
                                                        <skipDockerTag>${skip.docker.push}</skipDockerTag>
                                                </configuration>
                                        </execution>
                                                        <goal>push</goal>
                                                </goals>
                                                <configuration>
-                                                       <imageName>${docker.push.registry}/onap/dmaap/kafka01101:${KafkaImg}</imageName>
+                                                       <imageName>${docker.push.registry}/onap/dmaap/kafka01101:${dockertag2}</imageName>
                                                        <skipDockerPush>${skip.docker.push}</skipDockerPush>
                                                </configuration>
                                        </execution>
                                                        <goal>push</goal>
                                                </goals>
                                                <configuration>
-                                                       <imageName>${docker.push.registry}/onap/dmaap/kafka01101:latest</imageName>
+                                                       <imageName>${docker.push.registry}/onap/dmaap/kafka01101:${dockertag1}</imageName>
                                                        <skipDockerPush>${skip.docker.push}</skipDockerPush>
                                                </configuration>
                                        </execution>
 
        <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-               <KafkaImg>0.0.3</KafkaImg>
+               <timestamp>${maven.build.timestamp}</timestamp>
+        <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
                <sitePath>/content/sites/site/org/onap/dmaap/kafka0111/${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 a34946a..2ec675c 100644 (file)
@@ -26,7 +26,7 @@
 
 major=0
 minor=0
-patch=3
+patch=4
 
 base_version=${major}.${minor}.${patch}