diff options
author | Timoney, Dan (dt5972) <dt5972@att.com> | 2018-09-12 15:31:10 -0400 |
---|---|---|
committer | Dan Timoney <dt5972@att.com> | 2018-09-13 15:04:11 +0000 |
commit | 74896075be266b6f974eb9e1042ca7c6b5ed70db (patch) | |
tree | 8736651c26934100e3dade17d26ee03ab0c157e3 /ms/neng | |
parent | 5eebfaa6ac0d4cb4fdf20d19ead7cd0303fc6f29 (diff) |
Control docker build with profile
Docker build should only be run if docker profile is enabled.
Change-Id: I6942c3e59b769053fd47d04fe98f3e4b95ea33dd
Issue-ID: CCSDK-558
Signed-off-by: Timoney, Dan (dt5972) <dt5972@att.com>
Diffstat (limited to 'ms/neng')
-rw-r--r-- | ms/neng/pom.xml | 142 |
1 files changed, 94 insertions, 48 deletions
diff --git a/ms/neng/pom.xml b/ms/neng/pom.xml index 8390350a..0c5832a8 100644 --- a/ms/neng/pom.xml +++ b/ms/neng/pom.xml @@ -54,6 +54,10 @@ <serviceArtifactName>ms-networkelementnamegen</serviceArtifactName> <project.version>0.3.0</project.version> <ccsdk.distribution.version>0.2.4</ccsdk.distribution.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> <profiles> @@ -109,6 +113,63 @@ </build> </profile> + <profile> + <id>docker</id> + <build> + <plugins> + <plugin> + <groupId>com.spotify</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>0.4.11</version> + <configuration> + <imageName>onap/ccsdk-apps-ms-neng:${project.version}</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> + <resource> + <targetPath>/</targetPath> + <directory>${project.build.directory}</directory> + <include>opt/etc/config/*</include> + </resource> + <resource> + <targetPath>/</targetPath> + <directory>${project.build.directory}</directory> + <include>opt/etc/keystore/*</include> + </resource> + <resource> + <targetPath>/</targetPath> + <directory>${project.build.directory}</directory> + <include>opt/etc/truststore/*</include> + </resource> + <resource> + <targetPath>/</targetPath> + <directory>${project.build.directory}</directory> + <include>opt/aai/keystore/*</include> + </resource> + <resource> + <targetPath>/</targetPath> + <directory>${project.build.directory}</directory> + <include>etc/*</include> + </resource> + </resources> + </configuration> + </plugin> + </plugins> + </build> + </profile> + </profiles> <developers> @@ -260,6 +321,37 @@ <finalName>NetworkElementNameGen</finalName> <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.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.7.5.201505241946</version> @@ -433,54 +525,7 @@ </plugin> --> - <plugin> - <groupId>com.spotify</groupId> - <artifactId>docker-maven-plugin</artifactId> - <version>0.4.11</version> - <configuration> - <imageName>onap/ccsdk-apps-ms-neng:${project.version}</imageName> - <dockerDirectory>src/main/docker</dockerDirectory> - <serverId>docker-hub</serverId> - <registryUrl>https://${docker.registry}</registryUrl> - <imageTags> - <imageTag>${project.version}</imageTag> - <imageTag>latest</imageTag> - </imageTags> - <forceTags>true</forceTags> - <resources> - <resource> - <targetPath>/</targetPath> - <directory>${project.build.directory}</directory> - <include>${project.build.finalName}.jar</include> - </resource> - <resource> - <targetPath>/</targetPath> - <directory>${project.build.directory}</directory> - <include>opt/etc/config/*</include> - </resource> - <resource> - <targetPath>/</targetPath> - <directory>${project.build.directory}</directory> - <include>opt/etc/keystore/*</include> - </resource> - <resource> - <targetPath>/</targetPath> - <directory>${project.build.directory}</directory> - <include>opt/etc/truststore/*</include> - </resource> - <resource> - <targetPath>/</targetPath> - <directory>${project.build.directory}</directory> - <include>opt/aai/keystore/*</include> - </resource> - <resource> - <targetPath>/</targetPath> - <directory>${project.build.directory}</directory> - <include>etc/*</include> - </resource> - </resources> - </configuration> - </plugin> + <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> @@ -593,5 +638,6 @@ </plugins> </pluginManagement> </build> + </project> |