OCI image spec labels for DROOLS-PDP
[policy/drools-pdp.git] / packages / docker / pom.xml
1 <!--
2   ============LICENSE_START=======================================================
3   ONAP Policy Engine - Docker files
4   ================================================================================
5   Copyright (C) 2017-2018, 2021 AT&T Intellectual Property. All rights reserved.
6   Modifications Copyright (C) 2019-2020 Bell Canada.
7   Modifications Copyright (C) 2022 Nordix Foundation.
8   ================================================================================
9   Licensed under the Apache License, Version 2.0 (the "License");
10   you may not use this file except in compliance with the License.
11   You may obtain a copy of the License at
12
13          http://www.apache.org/licenses/LICENSE-2.0
14
15   Unless required by applicable law or agreed to in writing, software
16   distributed under the License is distributed on an "AS IS" BASIS,
17   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   See the License for the specific language governing permissions and
19   limitations under the License.
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" 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.drools-pdp</groupId>
29         <artifactId>drools-packages</artifactId>
30         <version>1.11.0-SNAPSHOT</version>
31     </parent>
32
33     <artifactId>docker</artifactId>
34     <packaging>pom</packaging>
35     <name>Policy Drools PDP - Docker build</name>
36     <description>ONAP Policy Drools PDP Docker Build</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         <docker.skip.deployconfig>true</docker.skip.deployconfig>
46         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
47         <docker.buildArg.BUILD_VERSION_DROOLS>${project.version}</docker.buildArg.BUILD_VERSION_DROOLS>
48         <docker.buildArg.MVN_SNAPSHOT_REPO_URL>${nexusproxy}/${snapshots.path}</docker.buildArg.MVN_SNAPSHOT_REPO_URL>
49         <docker.buildArg.MVN_RELEASE_REPO_URL>${nexusproxy}/${releases.path}</docker.buildArg.MVN_RELEASE_REPO_URL>
50     </properties>
51
52     <build>
53         <finalName>${project.artifactId}-${project.version}</finalName>
54         <plugins>
55             <plugin>
56                 <groupId>org.codehaus.gmaven</groupId>
57                 <artifactId>groovy-maven-plugin</artifactId>
58                 <version>2.1.1</version>
59                 <executions>
60                     <execution>
61                         <phase>validate</phase>
62                         <goals>
63                             <goal>execute</goal>
64                         </goals>
65                         <configuration>
66                             <source>https://github.com/onap/policy-docker/raw/master/utils/groovy/docker-tag.groovy</source>
67                         </configuration>
68                     </execution>
69                 </executions>
70             </plugin>
71
72             <plugin>
73                 <groupId>io.github.git-commit-id</groupId>
74                 <artifactId>git-commit-id-maven-plugin</artifactId>
75                 <version>5.0.0</version>
76                 <executions>
77                     <execution>
78                         <id>get-the-git-infos</id>
79                         <goals>
80                             <goal>revision</goal>
81                         </goals>
82                         <phase>initialize</phase>
83                     </execution>
84                 </executions>
85                 <configuration>
86                     <skipPoms>false</skipPoms>
87                     <generateGitPropertiesFile>true</generateGitPropertiesFile>
88                     <includeOnlyProperties>
89                         <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
90                         <includeOnlyProperty>^git.commit.id.abbrev$</includeOnlyProperty>
91                     </includeOnlyProperties>
92                     <commitIdGenerationMode>full</commitIdGenerationMode>
93                 </configuration>
94             </plugin>
95
96             <plugin>
97                 <groupId>io.fabric8</groupId>
98                 <artifactId>docker-maven-plugin</artifactId>
99                 <configuration>
100                     <verbose>true</verbose>
101                     <apiVersion>1.23</apiVersion>
102                     <pullRegistry>${docker.pull.registry}</pullRegistry>
103                     <pushRegistry>${docker.push.registry}</pushRegistry>
104                     <images>
105                         <image>
106                             <name>onap/policy-drools</name>
107                             <build>
108                                 <cleanup>try</cleanup>
109                                 <dockerFile>${dockerFile}</dockerFile>
110                                 <tags>
111                                     <tag>${project.version}</tag>
112                                     <tag>${project.version}-${maven.build.timestamp}</tag>
113                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
114                                 </tags>
115                                 <assembly>
116                                     <inline>
117                                         <dependencySets>
118                                             <dependencySet>
119                                                 <includes>
120                                                     <include>org.onap.policy.drools-pdp:install-drools</include>
121                                                 </includes>
122                                                 <outputDirectory>.</outputDirectory>
123                                                 <outputFileNameMapping>install-drools.zip</outputFileNameMapping>
124                                             </dependencySet>
125                                         </dependencySets>
126                                     </inline>
127                                 </assembly>
128                             </build>
129                         </image>
130                     </images>
131                 </configuration>
132                 <executions>
133                     <execution>
134                         <id>clean-images</id>
135                         <phase>pre-clean</phase>
136                         <goals>
137                             <goal>remove</goal>
138                         </goals>
139                         <configuration>
140                             <removeAll>true</removeAll>
141                         </configuration>
142                     </execution>
143                     <execution>
144                         <id>generate-images</id>
145                         <phase>generate-sources</phase>
146                         <goals>
147                             <goal>build</goal>
148                         </goals>
149                     </execution>
150                     <execution>
151                         <id>push-images</id>
152                         <phase>deploy</phase>
153                         <goals>
154                             <goal>build</goal>
155                             <goal>push</goal>
156                         </goals>
157                     </execution>
158                 </executions>
159             </plugin>
160             <plugin>
161                 <groupId>org.apache.maven.plugins</groupId>
162                 <artifactId>maven-deploy-plugin</artifactId>
163                 <configuration>
164                     <skip>${docker.skip.deployconfig}</skip>
165                 </configuration>
166             </plugin>
167         </plugins>
168     </build>
169     <dependencies>
170         <dependency>
171             <groupId>${project.groupId}</groupId>
172             <artifactId>install-drools</artifactId>
173             <version>${project.version}</version>
174             <type>zip</type>
175         </dependency>
176     </dependencies>
177 </project>