Release policy/api
[policy/api.git] / packages / policy-api-docker / pom.xml
1 <!--
2   ============LICENSE_START=======================================================
3    Copyright (C) 2019,2021 AT&T Intellectual Property. All rights reserved.
4    Modifications Copyright (C) 2020-2022 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
27     <parent>
28         <groupId>org.onap.policy.api</groupId>
29         <artifactId>api-packages</artifactId>
30         <version>2.6.4</version>
31     </parent>
32
33     <packaging>pom</packaging>
34     <artifactId>policy-api-docker</artifactId>
35     <name>${project.artifactId}</name>
36     <description>Policy api docker image</description>
37
38     <properties>
39         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
40         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
41         <dist.project.version>${project.version}</dist.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         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
46     </properties>
47
48     <build>
49         <finalName>${project.artifactId}-${project.version}</finalName>
50         <plugins>
51             <plugin>
52                 <groupId>org.codehaus.gmaven</groupId>
53                 <artifactId>groovy-maven-plugin</artifactId>
54                 <version>2.1.1</version>
55                 <executions>
56                     <execution>
57                         <phase>validate</phase>
58                         <goals>
59                             <goal>execute</goal>
60                         </goals>
61                         <configuration>
62                             <source>https://github.com/onap/policy-docker/raw/master/utils/groovy/docker-tag.groovy</source>
63                         </configuration>
64                     </execution>
65                 </executions>
66             </plugin>
67
68             <plugin>
69                 <groupId>io.fabric8</groupId>
70                 <artifactId>docker-maven-plugin</artifactId>
71
72                 <configuration>
73                     <verbose>true</verbose>
74                     <apiVersion>1.23</apiVersion>
75                     <pullRegistry>${docker.pull.registry}</pullRegistry>
76                     <pushRegistry>${docker.push.registry}</pushRegistry>
77
78                     <images>
79                         <image>
80                             <name>onap/policy-api</name>
81                             <build>
82                                 <cleanup>try</cleanup>
83                                 <dockerFile>Dockerfile</dockerFile>
84                                 <tags>
85                                     <tag>${project.version}</tag>
86                                     <tag>${project.version}-${maven.build.timestamp}</tag>
87                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
88                                 </tags>
89                                 <assembly>
90                                     <inline>
91                                         <dependencySets>
92                                             <dependencySet>
93                                                 <includes>
94                                                     <include>org.onap.policy.api:policy-api-tarball</include>
95                                                 </includes>
96                                                 <outputDirectory>/lib</outputDirectory>
97                                                 <outputFileNameMapping>policy-api.tar.gz</outputFileNameMapping>
98                                             </dependencySet>
99                                             <dependencySet>
100                                                 <includes>
101                                                     <include>org.onap.policy.api:api-main</include>
102                                                 </includes>
103                                                 <outputFileNameMapping>api.jar</outputFileNameMapping>
104                                             </dependencySet>
105                                         </dependencySets>
106                                     </inline>
107                                 </assembly>
108                             </build>
109                         </image>
110                     </images>
111                 </configuration>
112
113                 <executions>
114                     <execution>
115                         <id>clean-images</id>
116                         <phase>pre-clean</phase>
117                         <goals>
118                             <goal>remove</goal>
119                         </goals>
120                         <configuration>
121                             <removeAll>true</removeAll>
122                         </configuration>
123                     </execution>
124
125                     <execution>
126                         <id>generate-images</id>
127                         <phase>generate-sources</phase>
128                         <goals>
129                             <goal>build</goal>
130                         </goals>
131                     </execution>
132
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-api</image>
142                         </configuration>
143                     </execution>
144                 </executions>
145             </plugin>
146
147             <plugin>
148                 <groupId>org.apache.maven.plugins</groupId>
149                 <artifactId>maven-deploy-plugin</artifactId>
150                 <configuration>
151                     <skip>true</skip>
152                 </configuration>
153             </plugin>
154         </plugins>
155     </build>
156
157     <dependencies>
158         <dependency>
159             <groupId>org.onap.policy.api</groupId>
160             <artifactId>policy-api-tarball</artifactId>
161             <version>${project.version}</version>
162             <classifier>tarball</classifier>
163             <type>tar.gz</type>
164         </dependency>
165     </dependencies>
166 </project>