blob: 0999ac4a50ab39397324b0c96f3e2f229fc840c3 [file] [log] [blame]
mmis461cafd2018-09-05 10:35:44 +01001<!--
2 ============LICENSE_START=======================================================
3 Copyright (C) 2018 Ericsson. All rights reserved.
Ram Krishna Vermaa5355402020-02-05 16:10:59 -05004 Modifications Copyright (C) 2020 Bell Canada.
mmis461cafd2018-09-05 10:35:44 +01005 ================================================================================
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17
18 SPDX-License-Identifier: Apache-2.0
19 ============LICENSE_END=========================================================
20-->
21
22<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23 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.distribution</groupId>
Ram Krishna Vermaa5355402020-02-05 16:10:59 -050029 <artifactId>distribution-packages</artifactId>
Ram Krishna Verma54e41a62020-10-27 13:57:08 -040030 <version>2.5.0-SNAPSHOT</version>
mmis461cafd2018-09-05 10:35:44 +010031 </parent>
32
33 <packaging>pom</packaging>
34 <artifactId>policy-distribution-docker</artifactId>
Ram Krishna Vermaa5355402020-02-05 16:10:59 -050035 <name>${project.artifactId}</name>
mmis461cafd2018-09-05 10:35:44 +010036 <description>Policy distribution docker image</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>
mmis8e9afaf2018-09-14 16:27:45 +010044 <docker.skip.push>false</docker.skip.push>
mmis461cafd2018-09-05 10:35:44 +010045 <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
46 <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
47 <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
48 </properties>
49
50 <build>
51 <finalName>${project.artifactId}-${project.version}</finalName>
52 <plugins>
53 <plugin>
54 <groupId>org.codehaus.groovy.maven</groupId>
55 <artifactId>gmaven-plugin</artifactId>
56 <version>1.0</version>
57 <executions>
58 <execution>
59 <phase>validate</phase>
60 <goals>
61 <goal>execute</goal>
62 </goals>
63 <configuration>
64 <source>
pdragoshb2f1e972019-06-26 13:54:26 -040065 println 'Project version: ' + project.properties['dist.project.version']
66 if (project.properties['dist.project.version'] != null) {
67 def versionArray = project.properties['dist.project.version'].split('-')
68 def minMaxVersionArray = versionArray[0].tokenize('.')
69 if (project.properties['dist.project.version'].endsWith("-SNAPSHOT")) {
70 project.properties['project.docker.latest.minmax.tag.version'] =
71 minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-SNAPSHOT-latest"
72 } else {
73 project.properties['project.docker.latest.minmax.tag.version'] =
74 minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-STAGING-latest"
75 }
76 println 'New tag for docker: ' + project.properties['project.docker.latest.minmax.tag.version']
mmis461cafd2018-09-05 10:35:44 +010077 }
mmis461cafd2018-09-05 10:35:44 +010078 </source>
79 </configuration>
80 </execution>
81 </executions>
82 </plugin>
83
84 <plugin>
85 <groupId>io.fabric8</groupId>
86 <artifactId>docker-maven-plugin</artifactId>
mmis461cafd2018-09-05 10:35:44 +010087
88 <configuration>
89 <verbose>true</verbose>
90 <apiVersion>1.23</apiVersion>
91 <pullRegistry>${docker.pull.registry}</pullRegistry>
92 <pushRegistry>${docker.push.registry}</pushRegistry>
93
94 <images>
95 <image>
96 <name>onap/policy-distribution</name>
97 <build>
98 <cleanup>try</cleanup>
99 <dockerFile>Dockerfile</dockerFile>
100 <tags>
101 <tag>${project.version}</tag>
102 <tag>${project.version}-${maven.build.timestamp}</tag>
pdragoshb2f1e972019-06-26 13:54:26 -0400103 <tag>${project.docker.latest.minmax.tag.version}</tag>
mmis461cafd2018-09-05 10:35:44 +0100104 </tags>
105 <assembly>
106 <inline>
107 <dependencySets>
108 <dependencySet>
109 <includes>
110 <include>org.onap.policy.distribution:policy-distribution-tarball</include>
111 </includes>
112 <outputDirectory>/lib</outputDirectory>
113 <outputFileNameMapping>policy-distribution.tar.gz</outputFileNameMapping>
114 </dependencySet>
115 </dependencySets>
116 </inline>
117 </assembly>
118 </build>
119 </image>
120 </images>
121 </configuration>
122
123 <executions>
124 <execution>
125 <id>clean-images</id>
126 <phase>pre-clean</phase>
127 <goals>
128 <goal>remove</goal>
129 </goals>
130 <configuration>
131 <removeAll>true</removeAll>
132 </configuration>
133 </execution>
134
135 <execution>
136 <id>generate-images</id>
137 <phase>generate-sources</phase>
138 <goals>
139 <goal>build</goal>
140 </goals>
141 </execution>
142
143 <execution>
144 <id>push-images</id>
145 <phase>deploy</phase>
146 <goals>
147 <goal>build</goal>
148 <goal>push</goal>
149 </goals>
150 <configuration>
151 <image>onap/policy-distribution</image>
152 </configuration>
153 </execution>
154 </executions>
155 </plugin>
156
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
167 <dependencies>
168 <dependency>
169 <groupId>org.onap.policy.distribution</groupId>
170 <artifactId>policy-distribution-tarball</artifactId>
171 <version>${project.version}</version>
172 <classifier>tarball</classifier>
173 <type>tar.gz</type>
174 </dependency>
175 </dependencies>
176</project>