OCI image spec labels for 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.7.0-SNAPSHOT</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         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
47     </properties>
48
49     <build>
50         <finalName>${project.artifactId}-${project.version}</finalName>
51         <plugins>
52             <plugin>
53                 <groupId>org.codehaus.gmaven</groupId>
54                 <artifactId>groovy-maven-plugin</artifactId>
55                 <version>2.1.1</version>
56                 <executions>
57                     <execution>
58                         <phase>validate</phase>
59                         <goals>
60                             <goal>execute</goal>
61                         </goals>
62                         <configuration>
63                             <source>https://github.com/onap/policy-docker/raw/master/utils/groovy/docker-tag.groovy</source>
64                         </configuration>
65                     </execution>
66                 </executions>
67             </plugin>
68
69             <plugin>
70                 <groupId>io.github.git-commit-id</groupId>
71                 <artifactId>git-commit-id-maven-plugin</artifactId>
72                 <version>5.0.0</version>
73                 <executions>
74                     <execution>
75                         <id>get-the-git-infos</id>
76                         <goals>
77                             <goal>revision</goal>
78                         </goals>
79                         <phase>initialize</phase>
80                     </execution>
81                 </executions>
82                 <configuration>
83                     <skipPoms>false</skipPoms>
84                     <generateGitPropertiesFile>true</generateGitPropertiesFile>
85                     <includeOnlyProperties>
86                         <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
87                         <includeOnlyProperty>^git.commit.id.abbrev$</includeOnlyProperty>
88                     </includeOnlyProperties>
89                     <commitIdGenerationMode>full</commitIdGenerationMode>
90                 </configuration>
91             </plugin>
92
93             <plugin>
94                 <groupId>io.fabric8</groupId>
95                 <artifactId>docker-maven-plugin</artifactId>
96
97                 <configuration>
98                     <verbose>true</verbose>
99                     <apiVersion>1.23</apiVersion>
100                     <pullRegistry>${docker.pull.registry}</pullRegistry>
101                     <pushRegistry>${docker.push.registry}</pushRegistry>
102
103                     <images>
104                         <image>
105                             <name>onap/policy-api</name>
106                             <build>
107                                 <cleanup>try</cleanup>
108                                 <dockerFile>${dockerFile}</dockerFile>
109                                 <tags>
110                                     <tag>${project.version}</tag>
111                                     <tag>${project.version}-${maven.build.timestamp}</tag>
112                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
113                                 </tags>
114                                 <assembly>
115                                     <inline>
116                                         <dependencySets>
117                                             <dependencySet>
118                                                 <includes>
119                                                     <include>org.onap.policy.api:policy-api-tarball</include>
120                                                 </includes>
121                                                 <outputDirectory>/lib</outputDirectory>
122                                                 <outputFileNameMapping>policy-api.tar.gz</outputFileNameMapping>
123                                             </dependencySet>
124                                             <dependencySet>
125                                                 <includes>
126                                                     <include>org.onap.policy.api:api-main</include>
127                                                 </includes>
128                                                 <outputFileNameMapping>api.jar</outputFileNameMapping>
129                                             </dependencySet>
130                                         </dependencySets>
131                                     </inline>
132                                 </assembly>
133                             </build>
134                         </image>
135                     </images>
136                 </configuration>
137
138                 <executions>
139                     <execution>
140                         <id>clean-images</id>
141                         <phase>pre-clean</phase>
142                         <goals>
143                             <goal>remove</goal>
144                         </goals>
145                         <configuration>
146                             <removeAll>true</removeAll>
147                         </configuration>
148                     </execution>
149
150                     <execution>
151                         <id>generate-images</id>
152                         <phase>generate-sources</phase>
153                         <goals>
154                             <goal>build</goal>
155                         </goals>
156                     </execution>
157
158                     <execution>
159                         <id>push-images</id>
160                         <phase>deploy</phase>
161                         <goals>
162                             <goal>build</goal>
163                             <goal>push</goal>
164                         </goals>
165                         <configuration>
166                             <image>onap/policy-api</image>
167                         </configuration>
168                     </execution>
169                 </executions>
170             </plugin>
171
172             <plugin>
173                 <groupId>org.apache.maven.plugins</groupId>
174                 <artifactId>maven-deploy-plugin</artifactId>
175                 <configuration>
176                     <skip>true</skip>
177                 </configuration>
178             </plugin>
179         </plugins>
180     </build>
181
182     <dependencies>
183         <dependency>
184             <groupId>org.onap.policy.api</groupId>
185             <artifactId>policy-api-tarball</artifactId>
186             <version>${project.version}</version>
187             <classifier>tarball</classifier>
188             <type>tar.gz</type>
189         </dependency>
190     </dependencies>
191 </project>