diff options
author | 2017-10-12 19:44:38 +0800 | |
---|---|---|
committer | 2017-10-12 19:44:38 +0800 | |
commit | 17767843a7874a4d2748ad1c097369432b5524c2 (patch) | |
tree | 63d7ab7f40f6ec0860a5fb891c464767b1f65d60 | |
parent | 2cc04a25fe4ee4d9d144412d5c396ff0fa3941c1 (diff) |
Add the staging docker version.
Change-Id: I0870f59827508a519f79624638c38b469729fd16
Issue-ID: AAI-432
Signed-off-by: lizi <li.zi30@zte.com.cn>
-rw-r--r-- | standalone/pom.xml | 91 |
1 files changed, 87 insertions, 4 deletions
diff --git a/standalone/pom.xml b/standalone/pom.xml index b3bc7b2..f9d5e58 100644 --- a/standalone/pom.xml +++ b/standalone/pom.xml @@ -35,8 +35,13 @@ <linux64outputdir>target/assembly/${linux64id}</linux64outputdir> <win64outputdir>target/assembly/${win64id}</win64outputdir> <version.output>target/version</version.output> - </properties> - + <docker.image.name>onap/aai/esr-server</docker.image.name> + <maven.build.timestamp.format>yyyyMMdd-HHmm</maven.build.timestamp.format> + <docker.push.registry></docker.push.registry> + <skip.docker.build>true</skip.docker.build> + <skip.docker.tag>true</skip.docker.tag> + <skip.docker.push>true</skip.docker.push> + </properties> <build> <plugins> <plugin> @@ -189,7 +194,7 @@ </plugins> </build> - <profiles> + <!--<profiles> <profile> <id>docker</id> <build> @@ -236,8 +241,86 @@ </plugins> </build> </profile> + </profiles> --> + <profiles> + <profile> + <id>docker</id> + <build> + <plugins> + <plugin> + <groupId>com.spotify</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>0.4.11</version> + <inherited>false</inherited> + <configuration> + <images> + <image> + <imageName>onap/aai/esr-server</imageName> + <build> + <cleanup>try</cleanup> + <dockerFileDir>${basedir}/target/version/</dockerFileDir> + <dockerFile>${basedir}/target/version/Dockerfile</dockerFile> + </build> + </image> + </images> + </configuration> + <executions> + <execution> + <id>build-image</id> + <phase>package</phase> + <goals> + <goal>build</goal> + </goals> + <configuration> + <skipDockerBuild>${skip.docker.build}</skipDockerBuild> + </configuration> + </execution> + <execution> + <id>tag-image-timestamped-version</id> + <phase>deploy</phase> + <goals> + <goal>tag</goal> + </goals> + <configuration> + <image>${docker.image.name}</image> + <newName>${docker.push.registry}/${docker.image.name}:${project.version}-${maven.build.timestamp}</newName> + <pushImage>${skip.docker.push}</pushImage> + <skipDockerTag>${skip.docker.tag}</skipDockerTag> + </configuration> + </execution> + <execution> + <id>tag-image-project-version</id> + <phase>deploy</phase> + <goals> + <goal>tag</goal> + </goals> + <configuration> + <image>${docker.image.name}</image> + <newName>${docker.push.registry}/${docker.image.name}:${project.version}</newName> + <pushImage>${skip.docker.push}</pushImage> + <skipDockerTag>${skip.docker.tag}</skipDockerTag> + </configuration> + </execution> + <execution> + <id>tag-image-latest-version</id> + <phase>deploy</phase> + <goals> + <goal>tag</goal> + </goals> + <configuration> + <image>${docker.image.name}</image> + <newName>${docker.push.registry}/${docker.image.name}:latest</newName> + <pushImage>${skip.docker.push}</pushImage> + <skipDockerTag>${skip.docker.tag}</skipDockerTag> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> </profiles> - + <dependencies> <dependency> <groupId>org.onap.aai.esr-server</groupId> |