diff options
author | Lusheng <lji@research.att.com> | 2017-03-09 15:33:55 +0000 |
---|---|---|
committer | Lusheng <lji@research.att.com> | 2017-03-09 15:33:55 +0000 |
commit | f59b8236fe488ea6ccbfa570d8f4752c55e3bf42 (patch) | |
tree | 0a8c940e7fa654a508ce597839eae182ac85996f /pom.xml | |
parent | 02a05f195825791044891ba0b881b77df7eeabb6 (diff) |
docker versioning in pom
Change-Id: Ib04612dd90de5d2d51ce089bcda82bb9f46dd297
Signed-off-by: Lusheng <lji@research.att.com>
Diffstat (limited to 'pom.xml')
-rw-r--r-- | pom.xml | 58 |
1 files changed, 51 insertions, 7 deletions
@@ -6,16 +6,18 @@ <groupId>org.openecomp.dcae.inventory</groupId> <artifactId>dcae-inventory</artifactId> - <version>1.0.0-SNAPSHOT</version> + <version>1.0.0</version> <properties> <dropwizard.version>0.9.2</dropwizard.version> <logback.version>1.1.3</logback.version> <swagger-core.version>1.5.8</swagger-core.version> - <!-- For licensing --> <ecomp.inceptionYear>2017</ecomp.inceptionYear> <ecomp.organizationName>AT&T Intellectual Property. All rights reserved.</ecomp.organizationName> + + <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format> + <docker.registry>nexus3.openecomp.org:10003</docker.registry> </properties> <pluginRepositories> @@ -187,6 +189,19 @@ </sources> </configuration> </execution> + <execution> + <id>regex-property</id> + <goals> + <goal>regex-property</goal> + </goals> + <configuration> + <name>docker.version</name> + <value>${project.version}</value> + <regex>(^[0-9]+.[0-9]+.[0-9]+$)</regex> + <replacement>$1-STAGING</replacement> + <failIfNoMatch>false</failIfNoMatch> + </configuration> + </execution> </executions> </plugin> <!-- Package an Uber jar --> @@ -225,13 +240,9 @@ <version>0.4.11</version> <configuration> <!-- LOOK! Need to fill in registry here --> - <imageName>dcae-inventory</imageName> - <imageTags> - <imageTag>${project.version}</imageTag> - </imageTags> + <imageName>${project.artifactId}</imageName> <baseImage>openjdk:8-jre</baseImage> <entryPoint>["java", "-jar", "/opt/${project.build.finalName}.jar", "server", "/opt/config.yml"]</entryPoint> - <!-- copy the service's jar file from target into the root directory of the image --> <resources> <resource> <targetPath>/opt</targetPath> @@ -240,6 +251,39 @@ </resource> </resources> </configuration> + <executions> + <execution> + <id>build-image</id> + <phase>package</phase> + <goals> + <goal>build</goal> + </goals> + </execution> + <execution> + <id>tag-image-timestamped-version</id> + <phase>deploy</phase> + <goals> + <goal>tag</goal> + </goals> + <configuration> + <image>${project.artifactId}</image> + <newName>${docker.registry}/openecomp/${project.artifactId}:${docker.version}-${maven.build.timestamp}</newName> + <pushImage>true</pushImage> + </configuration> + </execution> + <execution> + <id>tag-image-latest-version</id> + <phase>deploy</phase> + <goals> + <goal>tag</goal> + </goals> + <configuration> + <image>${project.artifactId}</image> + <newName>${docker.registry}/openecomp/${project.artifactId}:LATEST</newName> + <pushImage>true</pushImage> + </configuration> + </execution> + </executions> </plugin> <!-- license plugin --> |