blob: 11d2f294e95a1b2ec7584d4f1bce9bff628fce5c [file] [log] [blame]
mmisef24b052018-07-10 10:50:05 +01001<!--
2 ============LICENSE_START=======================================================
3 Copyright (C) 2018 Ericsson. All rights reserved.
Ram Krishna Verma8d228522020-02-05 16:31:01 -05004 Modifications Copyright (C) 2019-2020 Bell Canada.
mmisef24b052018-07-10 10:50:05 +01005 ================================================================================
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17
18 SPDX-License-Identifier: Apache-2.0
19 ============LICENSE_END=========================================================
20-->
liamfallon3aa7cbe2018-10-31 16:35:54 +000021<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
mmisef24b052018-07-10 10:50:05 +010022 <modelVersion>4.0.0</modelVersion>
23 <parent>
24 <groupId>org.onap.policy.apex-pdp.packages</groupId>
Ram Krishna Verma8d228522020-02-05 16:31:01 -050025 <artifactId>apex-packages</artifactId>
a.sreekumar718adc02020-10-20 16:56:45 +010026 <version>2.4.4-SNAPSHOT</version>
mmisef24b052018-07-10 10:50:05 +010027 </parent>
28
29 <artifactId>apex-pdp-docker</artifactId>
30 <packaging>pom</packaging>
31 <name>Policy APEX PDP - Docker build</name>
32 <description>ONAP Policy APEX PDP Docker Build</description>
33
Rashmi Pujar7b945412019-06-17 10:34:49 -040034 <properties>
35 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
37 <dist.project.version>${project.version}</dist.project.version>
38 <docker.skip>false</docker.skip>
39 <docker.skip.build>false</docker.skip.build>
40 <docker.skip.push>false</docker.skip.push>
41 <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
42 <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
43 <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
44 </properties>
45
mmisef24b052018-07-10 10:50:05 +010046 <build>
Rashmi Pujar7b945412019-06-17 10:34:49 -040047 <finalName>${project.artifactId}-${project.version}</finalName>
mmisef24b052018-07-10 10:50:05 +010048 <plugins>
49 <plugin>
Rashmi Pujar7b945412019-06-17 10:34:49 -040050 <groupId>org.codehaus.groovy.maven</groupId>
51 <artifactId>gmaven-plugin</artifactId>
52 <version>1.0</version>
mmisef24b052018-07-10 10:50:05 +010053 <executions>
54 <execution>
Rashmi Pujar7b945412019-06-17 10:34:49 -040055 <phase>validate</phase>
mmisef24b052018-07-10 10:50:05 +010056 <goals>
Rashmi Pujar7b945412019-06-17 10:34:49 -040057 <goal>execute</goal>
mmisef24b052018-07-10 10:50:05 +010058 </goals>
59 <configuration>
Rashmi Pujar7b945412019-06-17 10:34:49 -040060 <source>
61 println 'Project version: ' + project.properties['dist.project.version']
62 if (project.properties['dist.project.version'] != null) {
63 def versionArray = project.properties['dist.project.version'].split('-')
64 def minMaxVersionArray = versionArray[0].tokenize('.')
65 if (project.properties['dist.project.version'].endsWith("-SNAPSHOT")) {
66 project.properties['project.docker.latest.minmax.tag.version'] =
67 minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-SNAPSHOT-latest"
68 } else {
69 project.properties['project.docker.latest.minmax.tag.version'] =
70 minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-STAGING-latest"
71 }
72 println 'New tag for docker: ' + properties['project.docker.latest.minmax.tag.version']
73 }
74 </source>
mmisef24b052018-07-10 10:50:05 +010075 </configuration>
76 </execution>
77 </executions>
78 </plugin>
79 <plugin>
Rashmi Pujar7b945412019-06-17 10:34:49 -040080 <groupId>io.fabric8</groupId>
81 <artifactId>docker-maven-plugin</artifactId>
mmisef24b052018-07-10 10:50:05 +010082 <configuration>
Rashmi Pujar7b945412019-06-17 10:34:49 -040083 <verbose>true</verbose>
84 <apiVersion>1.23</apiVersion>
85 <pullRegistry>${docker.pull.registry}</pullRegistry>
86 <pushRegistry>${docker.push.registry}</pushRegistry>
87 <images>
88 <image>
89 <name>onap/policy-apex-pdp</name>
90 <build>
91 <cleanup>try</cleanup>
92 <dockerFile>Dockerfile</dockerFile>
93 <tags>
94 <tag>${project.version}</tag>
95 <tag>${project.version}-${maven.build.timestamp}</tag>
96 <tag>${project.docker.latest.minmax.tag.version}</tag>
97 </tags>
98 <assembly>
99 <inline>
100 <dependencySets>
101 <dependencySet>
102 <includes>
103 <include>org.onap.policy.apex-pdp.packages:apex-pdp-package-full</include>
104 </includes>
105 <outputDirectory>.</outputDirectory>
106 <outputFileNameMapping>apex-pdp-package-full.tar.gz</outputFileNameMapping>
107 </dependencySet>
108 </dependencySets>
109 </inline>
110 </assembly>
111 </build>
112 </image>
113 </images>
114 </configuration>
115 <executions>
116 <execution>
117 <id>clean-images</id>
118 <phase>pre-clean</phase>
119 <goals>
120 <goal>remove</goal>
121 </goals>
122 <configuration>
123 <removeAll>true</removeAll>
124 </configuration>
125 </execution>
126 <execution>
127 <id>generate-images</id>
128 <phase>generate-sources</phase>
129 <goals>
130 <goal>build</goal>
131 </goals>
132 </execution>
133 <execution>
134 <id>push-images</id>
135 <phase>deploy</phase>
136 <goals>
137 <goal>build</goal>
138 <goal>push</goal>
139 </goals>
140 <configuration>
141 <image>onap/policy-apex-pdp</image>
142 </configuration>
143 </execution>
144 </executions>
145 </plugin>
146 <plugin>
147 <groupId>org.apache.maven.plugins</groupId>
148 <artifactId>maven-deploy-plugin</artifactId>
149 <configuration>
150 <skip>true</skip>
mmisef24b052018-07-10 10:50:05 +0100151 </configuration>
152 </plugin>
mmisef24b052018-07-10 10:50:05 +0100153 </plugins>
154 </build>
Rashmi Pujar7b945412019-06-17 10:34:49 -0400155 <dependencies>
156 <dependency>
157 <groupId>${project.groupId}</groupId>
158 <artifactId>apex-pdp-package-full</artifactId>
159 <version>${project.version}</version>
160 <type>tar.gz</type>
161 </dependency>
162 </dependencies>
Rashmi Pujar7b945412019-06-17 10:34:49 -0400163</project>