OpenSuse docker file for 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-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.fabric8</groupId>
71                 <artifactId>docker-maven-plugin</artifactId>
72
73                 <configuration>
74                     <verbose>true</verbose>
75                     <apiVersion>1.23</apiVersion>
76                     <pullRegistry>${docker.pull.registry}</pullRegistry>
77                     <pushRegistry>${docker.push.registry}</pushRegistry>
78
79                     <images>
80                         <image>
81                             <name>onap/policy-api</name>
82                             <build>
83                                 <cleanup>try</cleanup>
84                                 <dockerFile>${dockerFile}</dockerFile>
85                                 <tags>
86                                     <tag>${project.version}</tag>
87                                     <tag>${project.version}-${maven.build.timestamp}</tag>
88                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
89                                 </tags>
90                                 <assembly>
91                                     <inline>
92                                         <dependencySets>
93                                             <dependencySet>
94                                                 <includes>
95                                                     <include>org.onap.policy.api:policy-api-tarball</include>
96                                                 </includes>
97                                                 <outputDirectory>/lib</outputDirectory>
98                                                 <outputFileNameMapping>policy-api.tar.gz</outputFileNameMapping>
99                                             </dependencySet>
100                                             <dependencySet>
101                                                 <includes>
102                                                     <include>org.onap.policy.api:api-main</include>
103                                                 </includes>
104                                                 <outputFileNameMapping>api.jar</outputFileNameMapping>
105                                             </dependencySet>
106                                         </dependencySets>
107                                     </inline>
108                                 </assembly>
109                             </build>
110                         </image>
111                     </images>
112                 </configuration>
113
114                 <executions>
115                     <execution>
116                         <id>clean-images</id>
117                         <phase>pre-clean</phase>
118                         <goals>
119                             <goal>remove</goal>
120                         </goals>
121                         <configuration>
122                             <removeAll>true</removeAll>
123                         </configuration>
124                     </execution>
125
126                     <execution>
127                         <id>generate-images</id>
128                         <phase>generate-sources</phase>
129                         <goals>
130                             <goal>build</goal>
131                         </goals>
132                     </execution>
133
134                     <execution>
135                         <id>push-images</id>
136                         <phase>deploy</phase>
137                         <goals>
138                             <goal>build</goal>
139                             <goal>push</goal>
140                         </goals>
141                         <configuration>
142                             <image>onap/policy-api</image>
143                         </configuration>
144                     </execution>
145                 </executions>
146             </plugin>
147
148             <plugin>
149                 <groupId>org.apache.maven.plugins</groupId>
150                 <artifactId>maven-deploy-plugin</artifactId>
151                 <configuration>
152                     <skip>true</skip>
153                 </configuration>
154             </plugin>
155         </plugins>
156     </build>
157
158     <dependencies>
159         <dependency>
160             <groupId>org.onap.policy.api</groupId>
161             <artifactId>policy-api-tarball</artifactId>
162             <version>${project.version}</version>
163             <classifier>tarball</classifier>
164             <type>tar.gz</type>
165         </dependency>
166     </dependencies>
167 </project>