diff options
Diffstat (limited to 'ms/vlantag-api/pom.xml')
-rw-r--r-- | ms/vlantag-api/pom.xml | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/ms/vlantag-api/pom.xml b/ms/vlantag-api/pom.xml index 431d0a32..63036401 100644 --- a/ms/vlantag-api/pom.xml +++ b/ms/vlantag-api/pom.xml @@ -33,6 +33,10 @@ <sonar.jacoco.itReportPath>${basedir}/target/jacoco-it.exec</sonar.jacoco.itReportPath> <sonar.language>java</sonar.language> <ilib.version>2.0.7</ilib.version> + <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy> + <docker.push.phase>deploy</docker.push.phase> + <docker.verbose>true</docker.verbose> + <ccsdk.project.version>${project.version}</ccsdk.project.version> </properties> <parent> @@ -98,6 +102,37 @@ <build> <plugins> + <plugin> + <groupId>org.codehaus.groovy.maven</groupId> + <artifactId>gmaven-plugin</artifactId> + <version>1.0</version> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>execute</goal> + </goals> + <configuration> + <source> + println project.properties['ccsdk.project.version']; + def versionArray; + if (project.properties['ccsdk.project.version'] != null ) { + versionArray = project.properties['ccsdk.project.version'].split('\\.'); + } + + if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) + { + project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-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-surefire-plugin</artifactId> @@ -224,5 +259,39 @@ </plugins> </build> + <profiles> + <profile> + <id>docker</id> + <build> + <plugins> + <plugin> + <groupId>com.spotify</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>0.4.11</version> + <configuration> + <imageName>${docker.registry}/org.onap.ccsdk.apps/${serviceArtifactName}</imageName> + <dockerDirectory>src/main/docker</dockerDirectory> + <serverId>docker-hub</serverId> + <registryUrl>https://${docker.registry}</registryUrl> + <imageTags> + <imageTag>${project.version}</imageTag> + <imageTag>${project.version}-STAGING-${maven.build.timestamp}</imageTag> + <imageTag>${project.docker.latesttag.version}</imageTag> + </imageTags> + <forceTags>true</forceTags> + <resources> + <resource> + <targetPath>/</targetPath> + <directory>${project.build.directory}</directory> + <include>${project.build.finalName}.jar</include> + </resource> + </resources> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> + </project> |