Bump xacml-pdp to 2.4.7-SNAPSHOT
[policy/xacml-pdp.git] / packages / policy-xacmlpdp-docker / pom.xml
1 <!--
2   ============LICENSE_START=======================================================
3    Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
4    Modifications Copyright (C) 2020 Bell Canada.
5   ================================================================================
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>
28         <artifactId>xacml-packages</artifactId>
29         <version>2.4.7-SNAPSHOT</version>
30     </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'];
66                                 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']
77                                 }
78                             </source>
79                         </configuration>
80                     </execution>
81                 </executions>
82             </plugin>
83
84             <plugin>
85                 <groupId>io.fabric8</groupId>
86                 <artifactId>docker-maven-plugin</artifactId>
87
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:${project.version}</name>
97                             <build>
98                                 <cleanup>try</cleanup>
99                                 <dockerFile>Dockerfile</dockerFile>
100                                 <tags>
101                                     <tag>${project.version}-${maven.build.timestamp}</tag>
102                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
103                                 </tags>
104                                 <assembly>
105                                     <inline>
106                                         <dependencySets>
107                                             <dependencySet>
108                                                 <includes>
109                                                     <include>org.onap.policy.xacml-pdp:policy-xacmlpdp-tarball</include>
110                                                 </includes>
111                                                 <outputDirectory>/lib</outputDirectory>
112                                                 <outputFileNameMapping>policy-xacmlpdp.tar.gz</outputFileNameMapping>
113                                             </dependencySet>
114                                         </dependencySets>
115                                     </inline>
116                                 </assembly>
117                             </build>
118                         </image>
119                     </images>
120                 </configuration>
121
122                 <executions>
123                     <execution>
124                         <id>clean-images</id>
125                         <phase>pre-clean</phase>
126                         <goals>
127                             <goal>remove</goal>
128                         </goals>
129                         <configuration>
130                             <removeAll>true</removeAll>
131                         </configuration>
132                     </execution>
133
134                     <execution>
135                         <id>generate-images</id>
136                         <phase>generate-sources</phase>
137                         <goals>
138                             <goal>build</goal>
139                         </goals>
140                     </execution>
141
142                     <execution>
143                         <id>push-images</id>
144                         <phase>deploy</phase>
145                         <goals>
146                             <goal>build</goal>
147                             <goal>push</goal>
148                         </goals>
149                         <configuration>
150                             <image>onap/policy-xacml-pdp</image>
151                         </configuration>
152                     </execution>
153                 </executions>
154             </plugin>
155
156             <plugin>
157                 <groupId>org.apache.maven.plugins</groupId>
158                 <artifactId>maven-deploy-plugin</artifactId>
159                 <configuration>
160                     <skip>true</skip>
161                 </configuration>
162             </plugin>
163         </plugins>
164     </build>
165
166     <dependencies>
167         <dependency>
168             <groupId>org.onap.policy.xacml-pdp</groupId>
169             <artifactId>policy-xacmlpdp-tarball</artifactId>
170             <version>${project.version}</version>
171             <classifier>tarball</classifier>
172             <type>tar.gz</type>
173         </dependency>
174     </dependencies>
175 </project>