mmis | 824a75e | 2018-03-02 18:04:48 +0000 | [diff] [blame] | 1 | <!-- |
| 2 | ============LICENSE_START======================================================= |
| 3 | ONAP Policy Engine - Docker files |
| 4 | ================================================================================ |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 5 | Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. |
Rashmi Pujar | bb03caf | 2020-01-24 15:34:04 -0500 | [diff] [blame] | 6 | Modifications Copyright (C) 2019-2020 Bell Canada. |
mmis | 824a75e | 2018-03-02 18:04:48 +0000 | [diff] [blame] | 7 | ================================================================================ |
| 8 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | you may not use this file except in compliance with the License. |
| 10 | You may obtain a copy of the License at |
| 11 | |
| 12 | http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | |
| 14 | Unless required by applicable law or agreed to in writing, software |
| 15 | distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | See the License for the specific language governing permissions and |
| 18 | limitations under the License. |
| 19 | ============LICENSE_END========================================================= |
| 20 | --> |
| 21 | |
liamfallon | 9920020 | 2018-10-31 16:00:08 +0000 | [diff] [blame] | 22 | <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 | 824a75e | 2018-03-02 18:04:48 +0000 | [diff] [blame] | 23 | |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 24 | <modelVersion>4.0.0</modelVersion> |
mmis | 824a75e | 2018-03-02 18:04:48 +0000 | [diff] [blame] | 25 | |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 26 | <parent> |
| 27 | <groupId>org.onap.policy.drools-pdp</groupId> |
Ram Krishna Verma | 565dc1f | 2020-02-05 16:51:06 -0500 | [diff] [blame] | 28 | <artifactId>drools-packages</artifactId> |
Jim Hahn | 89a8e32 | 2019-09-10 11:22:40 -0400 | [diff] [blame] | 29 | <version>1.6.0-SNAPSHOT</version> |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 30 | </parent> |
mmis | 824a75e | 2018-03-02 18:04:48 +0000 | [diff] [blame] | 31 | |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 32 | <artifactId>docker</artifactId> |
| 33 | <packaging>pom</packaging> |
| 34 | <name>Policy Drools PDP - Docker build</name> |
| 35 | <description>ONAP Policy Drools PDP Docker Build</description> |
mmis | 824a75e | 2018-03-02 18:04:48 +0000 | [diff] [blame] | 36 | |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 37 | <properties> |
Rashmi Pujar | 7937bce | 2019-06-03 21:45:58 -0400 | [diff] [blame] | 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> |
| 47 | <docker.buildArg.BUILD_VERSION_DROOLS>${project.version}</docker.buildArg.BUILD_VERSION_DROOLS> |
Rashmi Pujar | bb03caf | 2020-01-24 15:34:04 -0500 | [diff] [blame] | 48 | <docker.buildArg.MVN_SNAPSHOT_REPO_URL>${nexusproxy}/${snapshots.path}</docker.buildArg.MVN_SNAPSHOT_REPO_URL> |
| 49 | <docker.buildArg.MVN_RELEASE_REPO_URL>${nexusproxy}/${releases.path}</docker.buildArg.MVN_RELEASE_REPO_URL> |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 50 | </properties> |
mmis | 824a75e | 2018-03-02 18:04:48 +0000 | [diff] [blame] | 51 | |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 52 | <build> |
Rashmi Pujar | 7937bce | 2019-06-03 21:45:58 -0400 | [diff] [blame] | 53 | <finalName>${project.artifactId}-${project.version}</finalName> |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 54 | <plugins> |
| 55 | <plugin> |
Rashmi Pujar | 7937bce | 2019-06-03 21:45:58 -0400 | [diff] [blame] | 56 | <groupId>org.codehaus.groovy.maven</groupId> |
| 57 | <artifactId>gmaven-plugin</artifactId> |
| 58 | <version>1.0</version> |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 59 | <executions> |
| 60 | <execution> |
Rashmi Pujar | 7937bce | 2019-06-03 21:45:58 -0400 | [diff] [blame] | 61 | <phase>validate</phase> |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 62 | <goals> |
Rashmi Pujar | 7937bce | 2019-06-03 21:45:58 -0400 | [diff] [blame] | 63 | <goal>execute</goal> |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 64 | </goals> |
| 65 | <configuration> |
Rashmi Pujar | 7937bce | 2019-06-03 21:45:58 -0400 | [diff] [blame] | 66 | <source> |
| 67 | println 'Project version: ' + project.properties['dist.project.version'] |
| 68 | if (project.properties['dist.project.version'] != null) { |
| 69 | def versionArray = project.properties['dist.project.version'].split('-') |
| 70 | def minMaxVersionArray = versionArray[0].tokenize('.') |
| 71 | if (project.properties['dist.project.version'].endsWith("-SNAPSHOT")) { |
| 72 | project.properties['project.docker.latest.minmax.tag.version'] = |
| 73 | minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-SNAPSHOT-latest" |
| 74 | } else { |
| 75 | project.properties['project.docker.latest.minmax.tag.version'] = |
| 76 | minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-STAGING-latest" |
| 77 | } |
| 78 | println 'New tag for docker: ' + project.properties['project.docker.latest.minmax.tag.version'] |
| 79 | } |
| 80 | </source> |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 81 | </configuration> |
| 82 | </execution> |
| 83 | </executions> |
| 84 | </plugin> |
| 85 | <plugin> |
Rashmi Pujar | 7937bce | 2019-06-03 21:45:58 -0400 | [diff] [blame] | 86 | <groupId>io.fabric8</groupId> |
| 87 | <artifactId>docker-maven-plugin</artifactId> |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 88 | <configuration> |
Rashmi Pujar | 7937bce | 2019-06-03 21:45:58 -0400 | [diff] [blame] | 89 | <verbose>true</verbose> |
| 90 | <apiVersion>1.23</apiVersion> |
| 91 | <pullRegistry>${docker.pull.registry}</pullRegistry> |
| 92 | <pushRegistry>${docker.push.registry}</pushRegistry> |
| 93 | <images> |
| 94 | <image> |
| 95 | <name>onap/policy-drools</name> |
| 96 | <build> |
| 97 | <cleanup>try</cleanup> |
| 98 | <dockerFile>Dockerfile</dockerFile> |
| 99 | <tags> |
| 100 | <tag>${project.version}</tag> |
| 101 | <tag>${project.version}-${maven.build.timestamp}</tag> |
| 102 | <tag>${project.docker.latest.minmax.tag.version}</tag> |
| 103 | </tags> |
| 104 | <assembly> |
| 105 | <inline> |
| 106 | <dependencySets> |
| 107 | <dependencySet> |
| 108 | <includes> |
| 109 | <include>org.onap.policy.drools-pdp:install-drools</include> |
| 110 | </includes> |
| 111 | <outputDirectory>.</outputDirectory> |
| 112 | <outputFileNameMapping>install-drools.zip</outputFileNameMapping> |
| 113 | </dependencySet> |
| 114 | </dependencySets> |
| 115 | </inline> |
| 116 | </assembly> |
| 117 | </build> |
| 118 | </image> |
| 119 | </images> |
| 120 | </configuration> |
| 121 | <executions> |
| 122 | <execution> |
| 123 | <id>clean-images</id> |
| 124 | <phase>pre-clean</phase> |
| 125 | <goals> |
| 126 | <goal>remove</goal> |
| 127 | </goals> |
| 128 | <configuration> |
| 129 | <removeAll>true</removeAll> |
| 130 | </configuration> |
| 131 | </execution> |
| 132 | <execution> |
| 133 | <id>generate-images</id> |
| 134 | <phase>generate-sources</phase> |
| 135 | <goals> |
| 136 | <goal>build</goal> |
| 137 | </goals> |
| 138 | </execution> |
| 139 | <execution> |
| 140 | <id>push-images</id> |
| 141 | <phase>deploy</phase> |
| 142 | <goals> |
| 143 | <goal>build</goal> |
| 144 | <goal>push</goal> |
| 145 | </goals> |
| 146 | <configuration> |
| 147 | <image>onap/policy-drools</image> |
| 148 | </configuration> |
| 149 | </execution> |
| 150 | </executions> |
| 151 | </plugin> |
| 152 | <plugin> |
| 153 | <groupId>org.apache.maven.plugins</groupId> |
| 154 | <artifactId>maven-deploy-plugin</artifactId> |
| 155 | <configuration> |
| 156 | <skip>true</skip> |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 157 | </configuration> |
| 158 | </plugin> |
Pamela Dragosh | fd307be | 2018-08-28 18:10:51 -0400 | [diff] [blame] | 159 | </plugins> |
| 160 | </build> |
Rashmi Pujar | 7937bce | 2019-06-03 21:45:58 -0400 | [diff] [blame] | 161 | <dependencies> |
| 162 | <dependency> |
| 163 | <groupId>${project.groupId}</groupId> |
| 164 | <artifactId>install-drools</artifactId> |
| 165 | <version>${project.version}</version> |
| 166 | <type>zip</type> |
| 167 | </dependency> |
| 168 | </dependencies> |
mmis | 824a75e | 2018-03-02 18:04:48 +0000 | [diff] [blame] | 169 | </project> |