blob: 473c90a3db347c5f3bac03f96144d7ee9547cc16 [file] [log] [blame]
Michael Mokryab1824d2019-02-13 10:34:48 -06001<!--
2 ============LICENSE_START=======================================================
3 Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
Ram Krishna Vermaec3592f2020-02-05 16:32:11 -05004 Modifications Copyright (C) 2020 Bell Canada.
Michael Mokryab1824d2019-02-13 10:34:48 -06005 ================================================================================
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-->
21
22<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24
25 <modelVersion>4.0.0</modelVersion>
26 <parent>
27 <groupId>org.onap.policy.xacml-pdp</groupId>
Ram Krishna Vermaec3592f2020-02-05 16:32:11 -050028 <artifactId>xacml-packages</artifactId>
Pamela Dragosh54aec032021-03-11 15:36:39 -050029 <version>2.5.0-SNAPSHOT</version>
Michael Mokryab1824d2019-02-13 10:34:48 -060030 </parent>
31
32 <packaging>pom</packaging>
33 <artifactId>policy-xacmlpdp-docker</artifactId>
34
35 <name>${project.artifactId}</name>
36 <description>Creates Policy Xacml PDP docker images</description>
37
38 <properties>
39 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
40 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
41 <pdpx.project.version>${project.version}</pdpx.project.version>
42 <docker.skip>false</docker.skip>
43 <docker.skip.build>false</docker.skip.build>
44 <docker.skip.push>false</docker.skip.push>
45 <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
46 <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
47 <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
48 </properties>
49
50 <build>
51 <finalName>${project.artifactId}-${project.version}</finalName>
52 <plugins>
53 <plugin>
54 <groupId>org.codehaus.groovy.maven</groupId>
55 <artifactId>gmaven-plugin</artifactId>
56 <version>1.0</version>
57 <executions>
58 <execution>
59 <phase>validate</phase>
60 <goals>
61 <goal>execute</goal>
62 </goals>
63 <configuration>
64 <source>
65 println 'Project version: ' + project.properties['pdpx.project.version'];
Pamela Dragosh0745cb92019-06-25 15:00:24 -040066 if (project.properties['pdpx.project.version'] != null) {
67 def versionArray = project.properties['pdpx.project.version'].split('-')
68 def minMaxVersionArray = versionArray[0].tokenize('.')
69 if (project.properties['pdpx.project.version'].endsWith("-SNAPSHOT")) {
70 project.properties['project.docker.latest.minmax.tag.version'] =
71 minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-SNAPSHOT-latest"
72 } else {
73 project.properties['project.docker.latest.minmax.tag.version'] =
74 minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-STAGING-latest"
75 }
76 println 'New tag for docker: ' + project.properties['project.docker.latest.minmax.tag.version']
Michael Mokryab1824d2019-02-13 10:34:48 -060077 }
Michael Mokryab1824d2019-02-13 10:34:48 -060078 </source>
79 </configuration>
80 </execution>
81 </executions>
82 </plugin>
83
84 <plugin>
85 <groupId>io.fabric8</groupId>
86 <artifactId>docker-maven-plugin</artifactId>
Michael Mokryab1824d2019-02-13 10:34:48 -060087
88 <configuration>
89 <verbose>true</verbose>
90 <apiVersion>1.23</apiVersion>
91 <pullRegistry>${docker.pull.registry}</pullRegistry>
92 <pushRegistry>${docker.push.registry}</pushRegistry>
93
94 <images>
95 <image>
96 <name>onap/policy-xacml-pdp</name>
97 <build>
98 <cleanup>try</cleanup>
99 <dockerFile>Dockerfile</dockerFile>
100 <tags>
101 <tag>${project.version}</tag>
102 <tag>${project.version}-${maven.build.timestamp}</tag>
Pamela Dragosh0745cb92019-06-25 15:00:24 -0400103 <tag>${project.docker.latest.minmax.tag.version}</tag>
Michael Mokryab1824d2019-02-13 10:34:48 -0600104 </tags>
105 <assembly>
106 <inline>
107 <dependencySets>
108 <dependencySet>
109 <includes>
Jorge Hernandeze6fd1ff2019-02-28 18:08:54 -0600110 <include>org.onap.policy.xacml-pdp:policy-xacmlpdp-tarball</include>
Michael Mokryab1824d2019-02-13 10:34:48 -0600111 </includes>
112 <outputDirectory>/lib</outputDirectory>
113 <outputFileNameMapping>policy-xacmlpdp.tar.gz</outputFileNameMapping>
114 </dependencySet>
115 </dependencySets>
116 </inline>
117 </assembly>
118 </build>
119 </image>
120 </images>
121 </configuration>
122
123 <executions>
124 <execution>
125 <id>clean-images</id>
126 <phase>pre-clean</phase>
127 <goals>
128 <goal>remove</goal>
129 </goals>
130 <configuration>
131 <removeAll>true</removeAll>
132 </configuration>
133 </execution>
134
135 <execution>
136 <id>generate-images</id>
137 <phase>generate-sources</phase>
138 <goals>
139 <goal>build</goal>
140 </goals>
141 </execution>
142
143 <execution>
144 <id>push-images</id>
145 <phase>deploy</phase>
146 <goals>
147 <goal>build</goal>
148 <goal>push</goal>
149 </goals>
150 <configuration>
Jorge Hernandeze6fd1ff2019-02-28 18:08:54 -0600151 <image>onap/policy-xacml-pdp</image>
Michael Mokryab1824d2019-02-13 10:34:48 -0600152 </configuration>
153 </execution>
154 </executions>
155 </plugin>
156
157 <plugin>
158 <groupId>org.apache.maven.plugins</groupId>
159 <artifactId>maven-deploy-plugin</artifactId>
160 <configuration>
161 <skip>true</skip>
162 </configuration>
163 </plugin>
164 </plugins>
165 </build>
166
167 <dependencies>
168 <dependency>
169 <groupId>org.onap.policy.xacml-pdp</groupId>
170 <artifactId>policy-xacmlpdp-tarball</artifactId>
171 <version>${project.version}</version>
172 <classifier>tarball</classifier>
173 <type>tar.gz</type>
174 </dependency>
175 </dependencies>
176</project>