summaryrefslogtreecommitdiffstats
path: root/packages/docker/pom.xml
diff options
context:
space:
mode:
Diffstat (limited to 'packages/docker/pom.xml')
-rw-r--r--packages/docker/pom.xml46
1 files changed, 41 insertions, 5 deletions
diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml
index c31a775290..5f271a9fac 100644
--- a/packages/docker/pom.xml
+++ b/packages/docker/pom.xml
@@ -20,12 +20,46 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- If the maven profile "docker" is specified the parameter -Dmso.git.url=<MsoGitRepo> must be provided
i.e: mvn clean install -P docker -Dmso.git.url=https://gerrit.openecomp.org/r-->
- <mso.git.url>${env.GIT_NO_PROJECT}</mso.git.url>
+ <mso.chef.git.url.prefix>${env.GIT_NO_PROJECT}</mso.chef.git.url.prefix>
+ <mso.chef.git.branchname>master</mso.chef.git.branchname>
+ <mso.chef.git.url.suffix.chef.repo>mso/chef-repo</mso.chef.git.url.suffix.chef.repo>
+ <mso.chef.git.url.suffix.chef.config>mso/mso-config</mso.chef.git.url.suffix.chef.config>
+ <mso.project.version>${project.version}</mso.project.version>
</properties>
<build>
<finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
+ <plugin>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>
+ println project.properties['mso.project.version'];
+ def versionArray;
+ if ( project.properties['mso.project.version'] != null ) {
+ versionArray = project.properties['mso.project.version'].split('\\.');
+ }
+
+ if ( project.properties['mso.project.version'].endsWith("-SNAPSHOT") ) {
+ project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-SNAPSHOT-latest";
+ } else {
+ project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
+ }
+
+ println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
@@ -38,9 +72,9 @@
</goals>
<phase>initialize</phase>
<configuration>
- <connectionUrl>scm:git:${mso.git.url}/mso/chef-repo</connectionUrl>
+ <connectionUrl>scm:git:${mso.chef.git.url.prefix}/${mso.chef.git.url.suffix.chef.repo}</connectionUrl>
<checkoutDirectory>src/main/docker/docker-files/chef-configs/chef-repo</checkoutDirectory>
- <scmVersion>master</scmVersion>
+ <scmVersion>${mso.chef.git.branchname}</scmVersion>
<scmVersionType>branch</scmVersionType>
<skipCheckoutIfExists>true</skipCheckoutIfExists>
<pushChanges>false</pushChanges>
@@ -53,9 +87,9 @@
</goals>
<phase>initialize</phase>
<configuration>
- <connectionUrl>scm:git:${mso.git.url}/mso/mso-config</connectionUrl>
+ <connectionUrl>scm:git:${mso.chef.git.url.prefix}/${mso.chef.git.url.suffix.chef.config}</connectionUrl>
<checkoutDirectory>src/main/docker/docker-files/chef-configs/mso-config</checkoutDirectory>
- <scmVersion>master</scmVersion>
+ <scmVersion>${mso.chef.git.branchname}</scmVersion>
<scmVersionType>branch</scmVersionType>
<skipCheckoutIfExists>true</skipCheckoutIfExists>
<pushChanges>false</pushChanges>
@@ -110,6 +144,7 @@
<alias>mso-arquillian</alias>
<build>
<tags>
+ <tag>${project.docker.latesttag.version}</tag>
<tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
</tags>
<cleanup>try</cleanup>
@@ -124,6 +159,7 @@
<build>
<tags>
<tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
+ <tag>${project.docker.latesttag.version}</tag>
</tags>
<cleanup>try</cleanup>
<dockerFileDir>docker-files</dockerFileDir>