c2ea4a28f9484feadc091874b6266ab918fdf4d3
[policy/models.git] / models-sim / packages / models-simulator-docker / pom.xml
1 <!--
2   ============LICENSE_START=======================================================
3    Copyright (C) 2020 Bell Canada.
4    Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
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     <modelVersion>4.0.0</modelVersion>
26     <parent>
27         <groupId>org.onap.policy.models.sim</groupId>
28         <artifactId>models-sim-packages</artifactId>
29         <version>2.8.1-SNAPSHOT</version>
30     </parent>
31
32     <artifactId>models-simulator-docker</artifactId>
33     <packaging>pom</packaging>
34
35     <name>${project.artifactId}</name>
36     <description>The module for creating docker images of Simulators component.</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.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
46         <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
47         <docker.contextDir>${project.basedir}/src/main/docker</docker.contextDir>
48         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
49         <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. -->
50         <sonar.skip>true</sonar.skip>
51     </properties>
52
53     <build>
54         <finalName>${project.artifactId}-${project.version}</finalName>
55         <plugins>
56             <plugin>
57                 <groupId>org.codehaus.gmaven</groupId>
58                 <artifactId>groovy-maven-plugin</artifactId>
59                 <version>2.1.1</version>
60                 <executions>
61                     <execution>
62                         <phase>validate</phase>
63                         <goals>
64                             <goal>execute</goal>
65                         </goals>
66                         <configuration>
67                             <source>https://github.com/onap/policy-docker/raw/master/utils/groovy/docker-tag.groovy</source>
68                         </configuration>
69                     </execution>
70                 </executions>
71             </plugin>
72
73             <plugin>
74                 <groupId>io.github.git-commit-id</groupId>
75                 <artifactId>git-commit-id-maven-plugin</artifactId>
76             </plugin>
77
78             <plugin>
79                 <groupId>io.fabric8</groupId>
80                 <artifactId>docker-maven-plugin</artifactId>
81
82                 <configuration>
83                     <verbose>true</verbose>
84                     <apiVersion>1.23</apiVersion>
85                     <pullRegistry>${docker.pull.registry}</pullRegistry>
86                     <pushRegistry>${docker.push.registry}</pushRegistry>
87
88                     <images>
89                         <image>
90                             <name>onap/policy-models-simulator</name>
91                             <build>
92                                 <cleanup>try</cleanup>
93                                 <dockerFile>${dockerFile}</dockerFile>
94                                 <contextDir>${docker.contextDir}</contextDir>
95                                 <tags>
96                                     <tag>${project.version}</tag>
97                                     <tag>${project.version}-${maven.build.timestamp}</tag>
98                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
99                                 </tags>
100                                 <assembly>
101                                     <inline>
102                                         <dependencySets>
103                                             <dependencySet>
104                                                 <includes>
105                                                     <include>org.onap.policy.models.sim:models-simulator-tarball</include>
106                                                 </includes>
107                                                 <outputDirectory>/lib</outputDirectory>
108                                                 <outputFileNameMapping>models-simulator.tar.gz</outputFileNameMapping>
109                                             </dependencySet>
110                                         </dependencySets>
111                                     </inline>
112                                 </assembly>
113                             </build>
114                         </image>
115                     </images>
116                 </configuration>
117
118                 <executions>
119                     <execution>
120                         <id>clean-images</id>
121                         <phase>pre-clean</phase>
122                         <goals>
123                             <goal>remove</goal>
124                         </goals>
125                         <configuration>
126                             <removeAll>true</removeAll>
127                         </configuration>
128                     </execution>
129
130                     <execution>
131                         <id>generate-images</id>
132                         <phase>generate-sources</phase>
133                         <goals>
134                             <goal>build</goal>
135                         </goals>
136                     </execution>
137
138                     <execution>
139                         <id>push-images</id>
140                         <phase>deploy</phase>
141                         <goals>
142                             <goal>build</goal>
143                             <goal>push</goal>
144                         </goals>
145                         <configuration>
146                             <image>onap/policy-models-simulator</image>
147                         </configuration>
148                     </execution>
149                 </executions>
150             </plugin>
151
152             <plugin>
153                 <groupId>org.apache.maven.plugins</groupId>
154                 <artifactId>maven-deploy-plugin</artifactId>
155                 <configuration>
156                     <skip>true</skip>
157                 </configuration>
158             </plugin>
159         </plugins>
160     </build>
161
162     <dependencies>
163         <dependency>
164             <groupId>org.onap.policy.models.sim</groupId>
165             <artifactId>models-simulator-tarball</artifactId>
166             <version>${project.version}</version>
167             <classifier>tarball</classifier>
168             <type>tar.gz</type>
169         </dependency>
170     </dependencies>
171 </project>