Set all cross references of policy/drools-applications
[policy/drools-applications.git] / controlloop / packages / docker-controlloop / pom.xml
1 <!--
2   ============LICENSE_START=======================================================
3   ONAP
4   ================================================================================
5   Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
6   Modifications Copyright (C) 2019-2020 Bell Canada.
7   Modifications Copyright (C) 2022-2023 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"
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     <parent>
28         <groupId>org.onap.policy.drools-applications.controlloop.packages</groupId>
29         <artifactId>drools-applications-packages</artifactId>
30         <version>2.1.3-SNAPSHOT</version>
31     </parent>
32     <artifactId>docker-controlloop</artifactId>
33     <packaging>pom</packaging>
34
35     <name>docker-controlloop</name>
36     <description>ONAP Policy Control Loop PDP-D Docker Build</description>
37
38     <properties>
39         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
40         <dist.project.version>${project.version}</dist.project.version>
41         <docker.skip>false</docker.skip>
42         <docker.skip.build>false</docker.skip.build>
43         <docker.skip.push>false</docker.skip.push>
44         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
45         <docker.buildArg.BUILD_VERSION_APP_CL>${project.version}</docker.buildArg.BUILD_VERSION_APP_CL>
46     </properties>
47
48     <build>
49         <finalName>${project.artifactId}-${project.version}</finalName>
50         <plugins>
51             <plugin>
52                 <groupId>org.codehaus.gmaven</groupId>
53                 <artifactId>groovy-maven-plugin</artifactId>
54                 <executions>
55                     <execution>
56                         <phase>validate</phase>
57                         <goals>
58                             <goal>execute</goal>
59                         </goals>
60                         <configuration>
61                             <source>https://github.com/onap/policy-docker/raw/master/utils/groovy/docker-tag.groovy</source>
62                         </configuration>
63                     </execution>
64                 </executions>
65             </plugin>
66
67             <plugin>
68                 <groupId>io.github.git-commit-id</groupId>
69                 <artifactId>git-commit-id-maven-plugin</artifactId>
70             </plugin>
71
72             <!--fabric8.io docker-maven-plugin does not support ARG usage in the FROM statement of Dockerfile
73              even though docker supports it: https://github.com/fabric8io/docker-maven-plugin/issues/859.
74              As a workaround we shall use maven-antrun-plugin to copy the Dockerfile and apply filters to
75              replace the parameterized base-image version. The fabric8.io docker-maven-plugin shall use this filtered file
76              to build the image. After the image is built we perform a cleanup to remove the filtered file.-->
77             <plugin>
78                 <groupId>org.apache.maven.plugins</groupId>
79                 <artifactId>maven-antrun-plugin</artifactId>
80                 <version>3.1.0</version>
81                 <executions>
82                     <execution>
83                         <id>update-parameterized-dockerfile</id>
84                         <phase>initialize</phase>
85                         <goals>
86                             <goal>run</goal>
87                         </goals>
88                         <configuration>
89                             <target>
90                                 <copy file="src/main/docker/Dockerfile"
91                                       toFile="${project.build.directory}/docker-tmp/Dockerfile">
92                                     <filterset>
93                                         <filter token="version.policy.drools-pdp" value="${version.policy.drools-pdp}"/>
94                                     </filterset>
95                                 </copy>
96                             </target>
97                         </configuration>
98                     </execution>
99                 </executions>
100             </plugin>
101             <plugin>
102                 <groupId>io.fabric8</groupId>
103                 <artifactId>docker-maven-plugin</artifactId>
104                 <configuration>
105                     <verbose>true</verbose>
106                     <apiVersion>1.23</apiVersion>
107                     <pullRegistry>${docker.pull.registry}</pullRegistry>
108                     <pushRegistry>${docker.push.registry}</pushRegistry>
109                     <images>
110                         <image>
111                             <name>onap/policy-pdpd-cl</name>
112                             <build>
113                                 <cleanup>try</cleanup>
114                                 <contextDir>${project.build.directory}/docker-tmp</contextDir>
115                                 <dockerFile>Dockerfile</dockerFile>
116                                 <tags>
117                                     <tag>${project.version}</tag>
118                                     <tag>${project.version}-${maven.build.timestamp}</tag>
119                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
120                                 </tags>
121                                 <assembly>
122                                     <descriptor>${project.basedir}/src/main/assembly/assembly.xml</descriptor>
123                                     <user>policy:policy:policy</user>
124                                 </assembly>
125                             </build>
126                         </image>
127                     </images>
128                 </configuration>
129                 <executions>
130                     <execution>
131                         <id>clean-images</id>
132                         <phase>pre-clean</phase>
133                         <goals>
134                             <goal>remove</goal>
135                         </goals>
136                         <configuration>
137                             <removeAll>true</removeAll>
138                         </configuration>
139                     </execution>
140                     <execution>
141                         <id>generate-images</id>
142                         <phase>generate-sources</phase>
143                         <goals>
144                             <goal>build</goal>
145                         </goals>
146                     </execution>
147                     <execution>
148                         <id>push-images</id>
149                         <phase>deploy</phase>
150                         <goals>
151                             <goal>build</goal>
152                             <goal>push</goal>
153                         </goals>
154                     </execution>
155                 </executions>
156             </plugin>
157             <plugin>
158                 <groupId>org.apache.maven.plugins</groupId>
159                 <artifactId>maven-deploy-plugin</artifactId>
160                 <configuration>
161                     <skip>true</skip>
162                 </configuration>
163             </plugin>
164         </plugins>
165     </build>
166     <dependencies>
167         <dependency>
168             <groupId>${project.groupId}</groupId>
169             <artifactId>apps-controlloop</artifactId>
170             <version>${project.version}</version>
171             <type>zip</type>
172         </dependency>
173     </dependencies>
174 </project>