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.7.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                 <version>5.0.0</version>
74                 <executions>
75                     <execution>
76                         <id>get-the-git-infos</id>
77                         <goals>
78                             <goal>revision</goal>
79                         </goals>
80                         <phase>initialize</phase>
81                     </execution>
82                 </executions>
83                 <configuration>
84                     <skipPoms>false</skipPoms>
85                     <generateGitPropertiesFile>true</generateGitPropertiesFile>
86                     <includeOnlyProperties>
87                         <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
88                         <includeOnlyProperty>^git.commit.id.abbrev$</includeOnlyProperty>
89                     </includeOnlyProperties>
90                     <commitIdGenerationMode>full</commitIdGenerationMode>
91                 </configuration>
92             </plugin>
93
94             <plugin>
95                 <groupId>io.fabric8</groupId>
96                 <artifactId>docker-maven-plugin</artifactId>
97
98                 <configuration>
99                     <verbose>true</verbose>
100                     <apiVersion>1.23</apiVersion>
101                     <pullRegistry>${docker.pull.registry}</pullRegistry>
102                     <pushRegistry>${docker.push.registry}</pushRegistry>
103
104                     <images>
105                         <image>
106                             <name>onap/policy-api</name>
107                             <build>
108                                 <cleanup>try</cleanup>
109                                 <dockerFile>${dockerFile}</dockerFile>
110                                 <contextDir>${docker.contextDir}</contextDir>
111                                 <tags>
112                                     <tag>${project.version}</tag>
113                                     <tag>${project.version}-${maven.build.timestamp}</tag>
114                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
115                                 </tags>
116                                 <assembly>
117                                     <inline>
118                                         <dependencySets>
119                                             <dependencySet>
120                                                 <includes>
121                                                     <include>org.onap.policy.api:policy-api-tarball</include>
122                                                 </includes>
123                                                 <outputDirectory>/lib</outputDirectory>
124                                                 <outputFileNameMapping>policy-api.tar.gz</outputFileNameMapping>
125                                             </dependencySet>
126                                             <dependencySet>
127                                                 <includes>
128                                                     <include>org.onap.policy.api:api-main</include>
129                                                 </includes>
130                                                 <outputFileNameMapping>api.jar</outputFileNameMapping>
131                                             </dependencySet>
132                                         </dependencySets>
133                                     </inline>
134                                 </assembly>
135                             </build>
136                         </image>
137                     </images>
138                 </configuration>
139
140                 <executions>
141                     <execution>
142                         <id>clean-images</id>
143                         <phase>pre-clean</phase>
144                         <goals>
145                             <goal>remove</goal>
146                         </goals>
147                         <configuration>
148                             <removeAll>true</removeAll>
149                         </configuration>
150                     </execution>
151
152                     <execution>
153                         <id>generate-images</id>
154                         <phase>generate-sources</phase>
155                         <goals>
156                             <goal>build</goal>
157                         </goals>
158                     </execution>
159
160                     <execution>
161                         <id>push-images</id>
162                         <phase>deploy</phase>
163                         <goals>
164                             <goal>build</goal>
165                             <goal>push</goal>
166                         </goals>
167                         <configuration>
168                             <image>onap/policy-api</image>
169                         </configuration>
170                     </execution>
171                 </executions>
172             </plugin>
173
174             <plugin>
175                 <groupId>org.apache.maven.plugins</groupId>
176                 <artifactId>maven-deploy-plugin</artifactId>
177                 <configuration>
178                     <skip>true</skip>
179                 </configuration>
180             </plugin>
181         </plugins>
182     </build>
183
184     <dependencies>
185         <dependency>
186             <groupId>org.onap.policy.api</groupId>
187             <artifactId>policy-api-tarball</artifactId>
188             <version>${project.version}</version>
189             <classifier>tarball</classifier>
190             <type>tar.gz</type>
191         </dependency>
192     </dependencies>
193 </project>