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    Modifications Copyright (C) 2022 Nordix Foundation.
6   ================================================================================
7   Licensed under the Apache License, Version 2.0 (the "License");
8   you may not use this file except in compliance with the License.
9   You may obtain a copy of the License at
10
11        http://www.apache.org/licenses/LICENSE-2.0
12
13   Unless required by applicable law or agreed to in writing, software
14   distributed under the License is distributed on an "AS IS" BASIS,
15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   See the License for the specific language governing permissions and
17   limitations under the License.
18
19   SPDX-License-Identifier: Apache-2.0
20   ============LICENSE_END=========================================================
21 -->
22
23 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
25
26     <modelVersion>4.0.0</modelVersion>
27
28     <parent>
29         <groupId>org.onap.policy.api</groupId>
30         <artifactId>api-packages</artifactId>
31         <version>2.8.0</version>
32     </parent>
33
34     <packaging>pom</packaging>
35     <artifactId>policy-api-docker</artifactId>
36     <name>${project.artifactId}</name>
37     <description>Policy api docker image</description>
38
39     <properties>
40         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
41         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
42         <dist.project.version>${project.version}</dist.project.version>
43         <docker.skip>false</docker.skip>
44         <docker.skip.build>false</docker.skip.build>
45         <docker.skip.push>false</docker.skip.push>
46         <docker.contextDir>${project.basedir}/src/main/docker</docker.contextDir>
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.gmaven</groupId>
55                 <artifactId>groovy-maven-plugin</artifactId>
56                 <version>2.1.1</version>
57                 <executions>
58                     <execution>
59                         <phase>validate</phase>
60                         <goals>
61                             <goal>execute</goal>
62                         </goals>
63                         <configuration>
64                             <source>https://github.com/onap/policy-docker/raw/master/utils/groovy/docker-tag.groovy</source>
65                         </configuration>
66                     </execution>
67                 </executions>
68             </plugin>
69
70             <plugin>
71                 <groupId>io.github.git-commit-id</groupId>
72                 <artifactId>git-commit-id-maven-plugin</artifactId>
73             </plugin>
74
75             <plugin>
76                 <groupId>io.fabric8</groupId>
77                 <artifactId>docker-maven-plugin</artifactId>
78
79                 <configuration>
80                     <verbose>true</verbose>
81                     <apiVersion>1.23</apiVersion>
82                     <pullRegistry>${docker.pull.registry}</pullRegistry>
83                     <pushRegistry>${docker.push.registry}</pushRegistry>
84
85                     <images>
86                         <image>
87                             <name>onap/policy-api</name>
88                             <build>
89                                 <cleanup>try</cleanup>
90                                 <dockerFile>${dockerFile}</dockerFile>
91                                 <contextDir>${docker.contextDir}</contextDir>
92                                 <tags>
93                                     <tag>${project.version}</tag>
94                                     <tag>${project.version}-${maven.build.timestamp}</tag>
95                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
96                                 </tags>
97                                 <assembly>
98                                     <inline>
99                                         <dependencySets>
100                                             <dependencySet>
101                                                 <includes>
102                                                     <include>org.onap.policy.api:policy-api-tarball</include>
103                                                 </includes>
104                                                 <outputDirectory>/lib</outputDirectory>
105                                                 <outputFileNameMapping>policy-api.tar.gz</outputFileNameMapping>
106                                             </dependencySet>
107                                             <dependencySet>
108                                                 <includes>
109                                                     <include>org.onap.policy.api:api-main</include>
110                                                 </includes>
111                                                 <outputFileNameMapping>api.jar</outputFileNameMapping>
112                                             </dependencySet>
113                                         </dependencySets>
114                                     </inline>
115                                 </assembly>
116                             </build>
117                         </image>
118                     </images>
119                 </configuration>
120
121                 <executions>
122                     <execution>
123                         <id>clean-images</id>
124                         <phase>pre-clean</phase>
125                         <goals>
126                             <goal>remove</goal>
127                         </goals>
128                         <configuration>
129                             <removeAll>true</removeAll>
130                         </configuration>
131                     </execution>
132
133                     <execution>
134                         <id>generate-images</id>
135                         <phase>generate-sources</phase>
136                         <goals>
137                             <goal>build</goal>
138                         </goals>
139                     </execution>
140
141                     <execution>
142                         <id>push-images</id>
143                         <phase>deploy</phase>
144                         <goals>
145                             <goal>build</goal>
146                             <goal>push</goal>
147                         </goals>
148                         <configuration>
149                             <image>onap/policy-api</image>
150                         </configuration>
151                     </execution>
152                 </executions>
153             </plugin>
154
155             <plugin>
156                 <groupId>org.apache.maven.plugins</groupId>
157                 <artifactId>maven-deploy-plugin</artifactId>
158                 <configuration>
159                     <skip>true</skip>
160                 </configuration>
161             </plugin>
162         </plugins>
163     </build>
164
165     <dependencies>
166         <dependency>
167             <groupId>org.onap.policy.api</groupId>
168             <artifactId>policy-api-tarball</artifactId>
169             <version>${project.version}</version>
170             <classifier>tarball</classifier>
171             <type>tar.gz</type>
172         </dependency>
173     </dependencies>
174 </project>