mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 1 | <!-- |
| 2 | ============LICENSE_START======================================================= |
| 3 | Copyright (C) 2018 Ericsson. All rights reserved. |
Ram Krishna Verma | 8d22852 | 2020-02-05 16:31:01 -0500 | [diff] [blame] | 4 | Modifications Copyright (C) 2019-2020 Bell Canada. |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 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 |
| 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 | --> |
liamfallon | 3aa7cbe | 2018-10-31 16:35:54 +0000 | [diff] [blame] | 21 | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 22 | <modelVersion>4.0.0</modelVersion> |
| 23 | <parent> |
| 24 | <groupId>org.onap.policy.apex-pdp.packages</groupId> |
Ram Krishna Verma | 8d22852 | 2020-02-05 16:31:01 -0500 | [diff] [blame] | 25 | <artifactId>apex-packages</artifactId> |
a.sreekumar | 718adc0 | 2020-10-20 16:56:45 +0100 | [diff] [blame] | 26 | <version>2.4.4-SNAPSHOT</version> |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 27 | </parent> |
| 28 | |
| 29 | <artifactId>apex-pdp-docker</artifactId> |
| 30 | <packaging>pom</packaging> |
| 31 | <name>Policy APEX PDP - Docker build</name> |
| 32 | <description>ONAP Policy APEX PDP Docker Build</description> |
| 33 | |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 34 | <properties> |
| 35 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 36 | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| 37 | <dist.project.version>${project.version}</dist.project.version> |
| 38 | <docker.skip>false</docker.skip> |
| 39 | <docker.skip.build>false</docker.skip.build> |
| 40 | <docker.skip.push>false</docker.skip.push> |
| 41 | <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry> |
| 42 | <docker.push.registry>nexus3.onap.org:10003</docker.push.registry> |
| 43 | <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format> |
| 44 | </properties> |
| 45 | |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 46 | <build> |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 47 | <finalName>${project.artifactId}-${project.version}</finalName> |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 48 | <plugins> |
| 49 | <plugin> |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 50 | <groupId>org.codehaus.groovy.maven</groupId> |
| 51 | <artifactId>gmaven-plugin</artifactId> |
| 52 | <version>1.0</version> |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 53 | <executions> |
| 54 | <execution> |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 55 | <phase>validate</phase> |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 56 | <goals> |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 57 | <goal>execute</goal> |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 58 | </goals> |
| 59 | <configuration> |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 60 | <source> |
| 61 | println 'Project version: ' + project.properties['dist.project.version'] |
| 62 | if (project.properties['dist.project.version'] != null) { |
| 63 | def versionArray = project.properties['dist.project.version'].split('-') |
| 64 | def minMaxVersionArray = versionArray[0].tokenize('.') |
| 65 | if (project.properties['dist.project.version'].endsWith("-SNAPSHOT")) { |
| 66 | project.properties['project.docker.latest.minmax.tag.version'] = |
| 67 | minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-SNAPSHOT-latest" |
| 68 | } else { |
| 69 | project.properties['project.docker.latest.minmax.tag.version'] = |
| 70 | minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-STAGING-latest" |
| 71 | } |
| 72 | println 'New tag for docker: ' + properties['project.docker.latest.minmax.tag.version'] |
| 73 | } |
| 74 | </source> |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 75 | </configuration> |
| 76 | </execution> |
| 77 | </executions> |
| 78 | </plugin> |
| 79 | <plugin> |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 80 | <groupId>io.fabric8</groupId> |
| 81 | <artifactId>docker-maven-plugin</artifactId> |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 82 | <configuration> |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 83 | <verbose>true</verbose> |
| 84 | <apiVersion>1.23</apiVersion> |
| 85 | <pullRegistry>${docker.pull.registry}</pullRegistry> |
| 86 | <pushRegistry>${docker.push.registry}</pushRegistry> |
| 87 | <images> |
| 88 | <image> |
| 89 | <name>onap/policy-apex-pdp</name> |
| 90 | <build> |
| 91 | <cleanup>try</cleanup> |
| 92 | <dockerFile>Dockerfile</dockerFile> |
| 93 | <tags> |
| 94 | <tag>${project.version}</tag> |
| 95 | <tag>${project.version}-${maven.build.timestamp}</tag> |
| 96 | <tag>${project.docker.latest.minmax.tag.version}</tag> |
| 97 | </tags> |
| 98 | <assembly> |
| 99 | <inline> |
| 100 | <dependencySets> |
| 101 | <dependencySet> |
| 102 | <includes> |
| 103 | <include>org.onap.policy.apex-pdp.packages:apex-pdp-package-full</include> |
| 104 | </includes> |
| 105 | <outputDirectory>.</outputDirectory> |
| 106 | <outputFileNameMapping>apex-pdp-package-full.tar.gz</outputFileNameMapping> |
| 107 | </dependencySet> |
| 108 | </dependencySets> |
| 109 | </inline> |
| 110 | </assembly> |
| 111 | </build> |
| 112 | </image> |
| 113 | </images> |
| 114 | </configuration> |
| 115 | <executions> |
| 116 | <execution> |
| 117 | <id>clean-images</id> |
| 118 | <phase>pre-clean</phase> |
| 119 | <goals> |
| 120 | <goal>remove</goal> |
| 121 | </goals> |
| 122 | <configuration> |
| 123 | <removeAll>true</removeAll> |
| 124 | </configuration> |
| 125 | </execution> |
| 126 | <execution> |
| 127 | <id>generate-images</id> |
| 128 | <phase>generate-sources</phase> |
| 129 | <goals> |
| 130 | <goal>build</goal> |
| 131 | </goals> |
| 132 | </execution> |
| 133 | <execution> |
| 134 | <id>push-images</id> |
| 135 | <phase>deploy</phase> |
| 136 | <goals> |
| 137 | <goal>build</goal> |
| 138 | <goal>push</goal> |
| 139 | </goals> |
| 140 | <configuration> |
| 141 | <image>onap/policy-apex-pdp</image> |
| 142 | </configuration> |
| 143 | </execution> |
| 144 | </executions> |
| 145 | </plugin> |
| 146 | <plugin> |
| 147 | <groupId>org.apache.maven.plugins</groupId> |
| 148 | <artifactId>maven-deploy-plugin</artifactId> |
| 149 | <configuration> |
| 150 | <skip>true</skip> |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 151 | </configuration> |
| 152 | </plugin> |
mmis | ef24b05 | 2018-07-10 10:50:05 +0100 | [diff] [blame] | 153 | </plugins> |
| 154 | </build> |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 155 | <dependencies> |
| 156 | <dependency> |
| 157 | <groupId>${project.groupId}</groupId> |
| 158 | <artifactId>apex-pdp-package-full</artifactId> |
| 159 | <version>${project.version}</version> |
| 160 | <type>tar.gz</type> |
| 161 | </dependency> |
| 162 | </dependencies> |
Rashmi Pujar | 7b94541 | 2019-06-17 10:34:49 -0400 | [diff] [blame] | 163 | </project> |