summaryrefslogtreecommitdiffstats
path: root/cps-parent
diff options
context:
space:
mode:
authorClaudio David Gasparini <claudio.gasparini@pantheon.tech>2020-11-16 17:37:15 +0100
committerClaudio David Gasparini <claudio.gasparini@pantheon.tech>2020-11-16 17:39:07 +0100
commit8710dc4267300485119485499de613279bce0e7b (patch)
tree7772bef2e3d9aa84ed7b40c12962c3618ef16389 /cps-parent
parentec650124e318a19a5a9b18fca134fb7fd46bd91e (diff)
Provide profile for build and deploy docker
By default profile will be disable Issue-ID: CPS-22 Signed-off-by: Claudio David Gasparini <claudio.gasparini@pantheon.tech> Change-Id: I4a605becf195b3f968d71a6ca1a0fd26e9c0a7be
Diffstat (limited to 'cps-parent')
-rw-r--r--cps-parent/pom.xml67
1 files changed, 51 insertions, 16 deletions
diff --git a/cps-parent/pom.xml b/cps-parent/pom.xml
index 643d2cc63f..ea979b1b94 100644
--- a/cps-parent/pom.xml
+++ b/cps-parent/pom.xml
@@ -27,6 +27,57 @@
<tag.version>${project.version}</tag.version>
</properties>
+ <profiles>
+ <profile>
+ <id>Docker</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>com.google.cloud.tools</groupId>
+ <artifactId>jib-maven-plugin</artifactId>
+ <version>${jib-maven-plugin.version}</version>
+ <configuration>
+ <container>
+ <mainClass>${app}</mainClass>
+ <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
+ </container>
+ <from>
+ <image>${base.image}</image>
+ </from>
+ <to>
+ <image>${repository.name}</image>
+ <tags>
+ <tag>${tag.version}</tag>
+ </tags>
+ </to>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <id>build</id>
+ <goals>
+ <goal>dockerBuild</goal>
+ </goals>
+ </execution>
+ <execution>
+ <phase>deploy</phase>
+ <id>buildAndPush</id>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ </profile>
+ </profiles>
+
<dependencyManagement>
<dependencies>
<dependency>
@@ -197,22 +248,6 @@
</tags>
</to>
</configuration>
- <executions>
- <execution>
- <phase>package</phase>
- <id>build</id>
- <goals>
- <goal>dockerBuild</goal>
- </goals>
- </execution>
- <execution>
- <phase>deploy</phase>
- <id>buildAndPush</id>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
- </executions>
</plugin>
</plugins>
</build>