2 ============LICENSE_START=======================================================
3 Copyright (C) 2019 Nordix Foundation.
4 Modifications Copyright (C) 2020 Bell Canada.
5 ================================================================================
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
10 http://www.apache.org/licenses/LICENSE-2.0
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.
18 SPDX-License-Identifier: Apache-2.0
19 ============LICENSE_END=========================================================
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 <modelVersion>4.0.0</modelVersion>
26 <groupId>org.onap.policy.pap</groupId>
27 <artifactId>pap-packages</artifactId>
28 <version>2.2.3-SNAPSHOT</version>
31 <artifactId>policy-pap-docker</artifactId>
32 <packaging>pom</packaging>
34 <name>${project.artifactId}</name>
35 <description>The module for creating docker images of PAP component.</description>
38 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
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 <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
45 <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
46 <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
50 <finalName>${project.artifactId}-${project.version}</finalName>
53 <groupId>org.codehaus.groovy.maven</groupId>
54 <artifactId>gmaven-plugin</artifactId>
55 <version>1.0</version>
58 <phase>validate</phase>
64 println 'Project version: ' + project.properties['dist.project.version']
65 if (project.properties['dist.project.version'] != null) {
66 def versionArray = project.properties['dist.project.version'].split('-')
67 def minMaxVersionArray = versionArray[0].tokenize('.')
68 if (project.properties['dist.project.version'].endsWith("-SNAPSHOT")) {
69 project.properties['project.docker.latest.minmax.tag.version'] =
70 minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-SNAPSHOT-latest"
72 project.properties['project.docker.latest.minmax.tag.version'] =
73 minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-STAGING-latest"
75 println 'New tag for docker: ' + project.properties['project.docker.latest.minmax.tag.version']
84 <groupId>io.fabric8</groupId>
85 <artifactId>docker-maven-plugin</artifactId>
88 <verbose>true</verbose>
89 <apiVersion>1.23</apiVersion>
90 <pullRegistry>${docker.pull.registry}</pullRegistry>
91 <pushRegistry>${docker.push.registry}</pushRegistry>
95 <name>onap/policy-pap</name>
97 <cleanup>try</cleanup>
98 <dockerFile>Dockerfile</dockerFile>
100 <tag>${project.version}</tag>
101 <tag>${project.version}-${maven.build.timestamp}</tag>
102 <tag>${project.docker.latest.minmax.tag.version}</tag>
109 <include>org.onap.policy.pap:policy-pap-tarball</include>
111 <outputDirectory>/lib</outputDirectory>
112 <outputFileNameMapping>policy-pap.tar.gz</outputFileNameMapping>
124 <id>clean-images</id>
125 <phase>pre-clean</phase>
130 <removeAll>true</removeAll>
135 <id>generate-images</id>
136 <phase>generate-sources</phase>
144 <phase>deploy</phase>
150 <image>onap/policy-pap</image>
157 <groupId>org.apache.maven.plugins</groupId>
158 <artifactId>maven-deploy-plugin</artifactId>
168 <groupId>org.onap.policy.pap</groupId>
169 <artifactId>policy-pap-tarball</artifactId>
170 <version>${project.version}</version>
171 <classifier>tarball</classifier>