diff options
author | sunil unnava <sunil.unnava@att.com> | 2019-02-13 17:45:31 -0500 |
---|---|---|
committer | sunil unnava <sunil.unnava@att.com> | 2019-02-13 17:47:06 -0500 |
commit | d566f9c26bd707725841d31def71a6d41a8db706 (patch) | |
tree | 60097814700a06b4ea2017421ef4d1bcfab5a4ce | |
parent | 21dffec3ea4d45fcc4e4140793ae231073cd6481 (diff) |
update docker image tags
Issue-ID: DMAAP-1042
Change-Id: Ia2fa750cb7507e6615a61ed3d7fe872709140939
Signed-off-by: sunil unnava <sunil.unnava@att.com>
-rw-r--r-- | pom.xml | 55 | ||||
-rw-r--r-- | version.properties | 2 |
2 files changed, 48 insertions, 9 deletions
@@ -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> @@ -123,8 +123,8 @@ <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> @@ -157,7 +157,7 @@ </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> @@ -170,7 +170,7 @@ </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> @@ -182,7 +182,7 @@ <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> @@ -194,7 +194,7 @@ <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> @@ -206,7 +206,8 @@ <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> @@ -234,6 +235,44 @@ <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> diff --git a/version.properties b/version.properties index 94925e5..b24f719 100644 --- a/version.properties +++ b/version.properties @@ -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 |