Set snapshot and/or references of policy/docker for new release
[policy/docker.git] / policy-db-migrator / pom.xml
1 <!--
2   ============LICENSE_START=======================================================
3    Copyright (C) 2021-2022 Nordix Foundation
4   ================================================================================
5   Licensed under the Apache License, Version 2.0 (the "License");
6   you may not use this file except in compliance with the License.
7   You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11   Unless required by applicable law or agreed to in writing, software
12   distributed under the License is distributed on an "AS IS" BASIS,
13   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   See the License for the specific language governing permissions and
15   limitations under the License.
16
17   SPDX-License-Identifier: Apache-2.0
18   ============LICENSE_END=========================================================
19 -->
20
21 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23     <modelVersion>4.0.0</modelVersion>
24     <parent>
25         <groupId>org.onap.policy.docker</groupId>
26         <artifactId>docker</artifactId>
27         <version>3.0.0-SNAPSHOT</version>
28     </parent>
29
30     <artifactId>policy-db-migrator</artifactId>
31     <packaging>pom</packaging>
32
33     <name>Policy db-migrator docker image</name>
34     <description>Policy db-migrator docker image.</description>
35
36     <properties>
37         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
38         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
39         <dist.project.version>${project.version}</dist.project.version>
40         <docker.skip>false</docker.skip>
41         <docker.skip.build>false</docker.skip.build>
42         <docker.skip.push>false</docker.skip.push>
43         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
44         <docker.dbm.imagename>onap/policy-db-migrator</docker.dbm.imagename>
45         <docker.dbm.dockerFile>Dockerfile</docker.dbm.dockerFile>
46         <docker.dbm.contextDir>${project.basedir}/src/main/docker</docker.dbm.contextDir>
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             <plugin>
69                 <groupId>io.github.git-commit-id</groupId>
70                 <artifactId>git-commit-id-maven-plugin</artifactId>
71             </plugin>
72             <plugin>
73                 <groupId>io.fabric8</groupId>
74                 <artifactId>docker-maven-plugin</artifactId>
75
76                 <configuration>
77                     <verbose>true</verbose>
78                     <apiVersion>1.23</apiVersion>
79                     <pullRegistry>${docker.pull.registry}</pullRegistry>
80                     <pushRegistry>${docker.push.registry}</pushRegistry>
81                     <images>
82                         <image>
83                             <name>${docker.dbm.imagename}</name>
84                             <build>
85                                 <cleanup>try</cleanup>
86                                 <dockerFile>${docker.dbm.dockerFile}</dockerFile>
87                                 <contextDir>${docker.dbm.contextDir}</contextDir>
88                                 <tags>
89                                     <tag>${project.version}</tag>
90                                     <tag>${project.version}-${maven.build.timestamp}</tag>
91                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
92                                 </tags>
93                             </build>
94                         </image>
95                     </images>
96                 </configuration>
97
98                 <executions>
99                     <execution>
100                         <id>clean-images</id>
101                         <phase>pre-clean</phase>
102                         <goals>
103                             <goal>remove</goal>
104                         </goals>
105                         <configuration>
106                             <removeAll>true</removeAll>
107                         </configuration>
108                     </execution>
109
110                     <execution>
111                         <id>generate-images</id>
112                         <phase>generate-sources</phase>
113                         <goals>
114                             <goal>build</goal>
115                         </goals>
116                     </execution>
117
118                     <execution>
119                         <id>push-images</id>
120                         <phase>deploy</phase>
121                         <goals>
122                             <goal>build</goal>
123                             <goal>push</goal>
124                         </goals>
125                         <configuration>
126                             <image>${docker.dbm.imagename}</image>
127                         </configuration>
128                     </execution>
129                 </executions>
130             </plugin>
131             <plugin>
132                 <groupId>org.apache.maven.plugins</groupId>
133                 <artifactId>maven-deploy-plugin</artifactId>
134                 <configuration>
135                     <skip>true</skip>
136                 </configuration>
137             </plugin>
138             <plugin>
139                 <groupId>org.apache.maven.plugins</groupId>
140                 <artifactId>maven-install-plugin</artifactId>
141                 <configuration>
142                     <skip>true</skip>
143                 </configuration>
144             </plugin>
145         </plugins>
146     </build>
147 </project>