diff options
author | 2020-06-16 12:10:00 +0200 | |
---|---|---|
committer | 2020-06-16 12:10:00 +0200 | |
commit | 264a5c64ff32720457c3f9d835fafb38591df4f5 (patch) | |
tree | d07ca8e4e66067ccdfbaaac4b2e0ea65afcce98f | |
parent | 27564b747db964cea07fe94d855ecedce6d6326d (diff) |
Add tagging to docker
Add tagging groovy script to docker images
Issue-ID: SDC-3097
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Change-Id: I4246a07fae11a4907d7d337fd882f074e36bc0b5
-rw-r--r-- | pom.xml | 38 | ||||
-rw-r--r-- | sdc-workflow-designer-be/pom.xml | 4 | ||||
-rw-r--r-- | sdc-workflow-designer-init/pom.xml | 4 | ||||
-rw-r--r-- | sdc-workflow-designer-ui/pom.xml | 4 |
4 files changed, 46 insertions, 4 deletions
@@ -36,8 +36,11 @@ <maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> + <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + <sdc.project.version>${project.version}</sdc.project.version> + <sdc.build.timestamp>${maven.build.timestamp}</sdc.build.timestamp> <onap.version>1.3.0</onap.version> <docker.optimize>true</docker.optimize> <docker.username>docker</docker.username> @@ -45,7 +48,6 @@ <nexus.registry>nexus3.onap.org:10001</nexus.registry> <nexus.proxy>https://nexus.onap.org</nexus.proxy> <sitePath>/content/sites/site/org/onap/sdc/workflow/${project.version}</sitePath> - <!-- Sonar properties --> <sonar.coverage.jacoco.xmlReportPaths> ${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml @@ -149,6 +151,40 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.codehaus.groovy.maven</groupId> + <artifactId>gmaven-plugin</artifactId> + <version>1.0</version> + <inherited>true</inherited> + <executions> + <execution> + <id>docker-tags</id> + <phase>validate</phase> + <goals> + <goal>execute</goal> + </goals> + <configuration> + <source> + println 'Docker Tagging Script:' + project.properties['sdc.project.version'] + '/' + project.properties['sdc.build.timestamp']; + def versionArray; + if ( project.properties['sdc.project.version'] != null ) { + versionArray = project.properties['sdc.project.version'].split('\\.'); + } + + if ( project.properties['sdc.project.version'].endsWith("-SNAPSHOT") ) { + project.properties.setProperty('project.docker.latesttag.version',versionArray[0] + '.' + versionArray[1] + "-SNAPSHOT-latest"); + project.properties.setProperty('project.docker.latesttagtimestamp.version',versionArray[0] + '.' + versionArray[1] + "-SNAPSHOT-"+project.properties['sdc.build.timestamp']); + } else { + project.properties.setProperty('project.docker.latesttag.version',versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"); + project.properties.setProperty('project.docker.latesttagtimestamp.version',versionArray[0] + '.' + versionArray[1] + "-STAGING-"+project.properties['sdc.build.timestamp']); + } + + println 'New Tags for docker:' + project.properties['project.docker.latesttag.version'] + '/' + project.properties['project.docker.latesttagtimestamp.version']; + </source> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> diff --git a/sdc-workflow-designer-be/pom.xml b/sdc-workflow-designer-be/pom.xml index aedc9ef0..c06314e0 100644 --- a/sdc-workflow-designer-be/pom.xml +++ b/sdc-workflow-designer-be/pom.xml @@ -223,7 +223,9 @@ <name>onap/sdc-workflow-backend</name> <build> <tags> - <tag>${project.version}</tag> + <tag>latest</tag> + <tag>${project.docker.latesttagtimestamp.version}</tag> + <tag>${project.docker.latesttag.version}</tag> </tags> <dockerFileDir>${project.basedir}/docker</dockerFileDir> <args> diff --git a/sdc-workflow-designer-init/pom.xml b/sdc-workflow-designer-init/pom.xml index 0a5b5a4a..240181d7 100644 --- a/sdc-workflow-designer-init/pom.xml +++ b/sdc-workflow-designer-init/pom.xml @@ -30,7 +30,9 @@ <name>onap/sdc-workflow-init</name> <build> <tags> - <tag>${project.version}</tag> + <tag>latest</tag> + <tag>${project.docker.latesttagtimestamp.version}</tag> + <tag>${project.docker.latesttag.version}</tag> </tags> <dockerFile>Dockerfile</dockerFile> </build> diff --git a/sdc-workflow-designer-ui/pom.xml b/sdc-workflow-designer-ui/pom.xml index 9c254e43..554d94b5 100644 --- a/sdc-workflow-designer-ui/pom.xml +++ b/sdc-workflow-designer-ui/pom.xml @@ -178,7 +178,9 @@ <name>onap/sdc-workflow-frontend</name> <build> <tags> - <tag>${project.version}</tag> + <tag>latest</tag> + <tag>${project.docker.latesttagtimestamp.version}</tag> + <tag>${project.docker.latesttag.version}</tag> </tags> <dockerFileDir>${project.basedir}/docker</dockerFileDir> <args> |