diff options
author | Jimmy Forsyth <jf2512@att.com> | 2019-08-27 12:31:36 -0400 |
---|---|---|
committer | Jimmy Forsyth <jf2512@att.com> | 2019-08-27 12:31:39 -0400 |
commit | b7f5a57561d9974cacae7628fbb987413b6ae25a (patch) | |
tree | 894851f693ce6784e9bab5534b5902177aab0eb8 | |
parent | 0c2169d55a7d567a15a561019c92536f390aef99 (diff) |
Set correct phases for version and image parsing
Issue-ID: AAI-2579
Signed-off-by: Jimmy Forsyth <jf2512@att.com>
Change-Id: Id6163c6788bb41380fc8ac0630f26cb3b5fabfd8
-rw-r--r-- | pom.xml | 220 |
1 files changed, 105 insertions, 115 deletions
@@ -379,129 +379,115 @@ limitations under the License. <id>docker</id> <build> <plugins> - - <plugin> - <groupId>io.fabric8</groupId> - <artifactId>docker-maven-plugin</artifactId> - <version>${docker.fabric.version}</version> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>3.0.0</version> + <executions> + <execution> + <phase>pre-clean</phase> + <id>parse-version</id> + <goals> + <goal>parse-version</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.groovy.maven</groupId> + <artifactId>gmaven-plugin</artifactId> + <version>1.0</version> + <executions> + <execution> + <phase>pre-clean</phase> + <goals> + <goal>execute</goal> + </goals> <configuration> - <verbose>true</verbose> - <apiVersion>1.23</apiVersion> - <images> - <image> - <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l - </name> - <build> - <filter>@</filter> - <tags> - <tag>latest</tag> - <tag>${project.docker.latesttag.version}</tag> - <tag>${project.major.version}.${project.minor.version}-STAGING-${maven.build.timestamp}</tag> - </tags> - <cleanup>try</cleanup> - <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir> - <assembly> - <inline> - <fileSets> - <fileSet> - <directory>${aai.build.directory}</directory> - <outputDirectory>/${project.artifactId}</outputDirectory> - </fileSet> - </fileSets> - </inline> - </assembly> - </build> - </image> - </images> - </configuration> - <executions> - <execution> - <id>clean-images</id> - <phase>pre-clean</phase> - <goals> - <goal>remove</goal> - </goals> - <configuration> - <removeAll>true</removeAll> - </configuration> - </execution> - <execution> - <id>generate-images</id> - <phase>package</phase> - <goals> - <goal>build</goal> - </goals> - </execution> - <execution> - <id>push-images</id> - <phase>deploy</phase> - <goals> - <goal>push</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <version>3.0.0</version> - <executions> - <execution> - <id>parse-version</id> - <goals> - <goal>parse-version</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> - - <build> - <finalName>${project.artifactId}</finalName> - <pluginManagement> - <plugins> + <source> + def userAaiBaseImage = session.userProperties['aai.base.image'] + def userAaiCommonVersion = session.userProperties['aai.base.image.version'] + if (userAaiCommonVersion != null) { + project.properties['aai.base.image.version'] = userAaiCommonVersion + } + if (userAaiBaseImage != null) { + project.properties['aai.base.image'] = userAaiBaseImage + } + log.info 'Base image flavour: ' + project.properties['aai.base.image'] + log.info 'Base image version: ' + project.properties['aai.base.image.version'] + </source> + </configuration> + </execution> + </executions> + </plugin> <plugin> - <groupId>org.codehaus.groovy.maven</groupId> - <artifactId>gmaven-plugin</artifactId> - <version>1.0</version> + <groupId>io.fabric8</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>${docker.fabric.version}</version> + <configuration> + <verbose>true</verbose> + <apiVersion>1.23</apiVersion> + <images> + <image> + <name>${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l + </name> + <build> + <filter>@</filter> + <tags> + <tag>latest</tag> + <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag> + <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp}</tag> + </tags> + <cleanup>try</cleanup> + <dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir> + <assembly> + <inline> + <fileSets> + <fileSet> + <directory>${aai.build.directory}</directory> + <outputDirectory>/${project.artifactId}</outputDirectory> + </fileSet> + </fileSets> + </inline> + </assembly> + </build> + </image> + </images> + </configuration> <executions> - <execution> - <phase>validate</phase> + <execution> + <id>clean-images</id> + <phase>pre-clean</phase> <goals> - <goal>execute</goal> + <goal>remove</goal> </goals> <configuration> - <source> - def userAaiBaseImage = session.userProperties['aai.base.image'] - def userAaiCommonVersion = session.userProperties['aai.base.image.version'] - if (userAaiCommonVersion != null) { - project.properties['aai.base.image.version'] = userAaiCommonVersion - } - if (userAaiBaseImage != null) { - project.properties['aai.base.image'] = userAaiBaseImage - } - log.info 'Base image flavour: ' + project.properties['aai.base.image'] - log.info 'Base image version: ' + project.properties['aai.base.image.version'] - - def versionArray; - if (project.properties['aai.base.image.version'] != null) { - versionArray = project.properties['aai.base.image.version'].split('\\.'); - } - - project.properties["project.major.version"] = versionArray[0]; - project.properties["project.minor.version"] = versionArray[1]; - 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> + <removeAll>true</removeAll> + </configuration> + </execution> + <execution> + <id>generate-images</id> + <phase>package</phase> + <goals> + <goal>build</goal> + </goals> + </execution> + <execution> + <id>push-images</id> + <phase>deploy</phase> + <goals> + <goal>push</goal> + </goals> + </execution> + </executions> </plugin> </plugins> - </pluginManagement> + </build> + </profile> + </profiles> + + <build> + <finalName>${project.artifactId}</finalName> <!-- Using https://code.revelc.net/formatter-maven-plugin/ for Eclipse formatter Using https://github.com/diffplug/spotless/tree/master/plugin-maven for import order @@ -521,6 +507,10 @@ limitations under the License. use mvn formatter:format to rewrite source files use mvn formatter:validate to validate source files --> </plugin> + <plugin> + <groupId>org.codehaus.groovy.maven</groupId> + <artifactId>gmaven-plugin</artifactId> + </plugin> <plugin> <groupId>com.diffplug.spotless</groupId> <artifactId>spotless-maven-plugin</artifactId> |