blob: 5c5b299b5c15a034e9dff4a1bb569e19903f9287 [file] [log] [blame]
mmis824a75e2018-03-02 18:04:48 +00001<!--
2 ============LICENSE_START=======================================================
3 ONAP Policy Engine - Docker files
4 ================================================================================
Pamela Dragoshfd307be2018-08-28 18:10:51 -04005 Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
Rashmi Pujarbb03caf2020-01-24 15:34:04 -05006 Modifications Copyright (C) 2019-2020 Bell Canada.
mmis824a75e2018-03-02 18:04:48 +00007 ================================================================================
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
liamfallon99200202018-10-31 16:00:08 +000022<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">
mmis824a75e2018-03-02 18:04:48 +000023
Pamela Dragoshfd307be2018-08-28 18:10:51 -040024 <modelVersion>4.0.0</modelVersion>
mmis824a75e2018-03-02 18:04:48 +000025
Pamela Dragoshfd307be2018-08-28 18:10:51 -040026 <parent>
27 <groupId>org.onap.policy.drools-pdp</groupId>
Ram Krishna Verma565dc1f2020-02-05 16:51:06 -050028 <artifactId>drools-packages</artifactId>
Jim Hahn89a8e322019-09-10 11:22:40 -040029 <version>1.6.0-SNAPSHOT</version>
Pamela Dragoshfd307be2018-08-28 18:10:51 -040030 </parent>
mmis824a75e2018-03-02 18:04:48 +000031
Pamela Dragoshfd307be2018-08-28 18:10:51 -040032 <artifactId>docker</artifactId>
33 <packaging>pom</packaging>
34 <name>Policy Drools PDP - Docker build</name>
35 <description>ONAP Policy Drools PDP Docker Build</description>
mmis824a75e2018-03-02 18:04:48 +000036
Pamela Dragoshfd307be2018-08-28 18:10:51 -040037 <properties>
Rashmi Pujar7937bce2019-06-03 21:45:58 -040038 <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 Pujarbb03caf2020-01-24 15:34:04 -050048 <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 Dragoshfd307be2018-08-28 18:10:51 -040050 </properties>
mmis824a75e2018-03-02 18:04:48 +000051
Pamela Dragoshfd307be2018-08-28 18:10:51 -040052 <build>
Rashmi Pujar7937bce2019-06-03 21:45:58 -040053 <finalName>${project.artifactId}-${project.version}</finalName>
Pamela Dragoshfd307be2018-08-28 18:10:51 -040054 <plugins>
55 <plugin>
Rashmi Pujar7937bce2019-06-03 21:45:58 -040056 <groupId>org.codehaus.groovy.maven</groupId>
57 <artifactId>gmaven-plugin</artifactId>
58 <version>1.0</version>
Pamela Dragoshfd307be2018-08-28 18:10:51 -040059 <executions>
60 <execution>
Rashmi Pujar7937bce2019-06-03 21:45:58 -040061 <phase>validate</phase>
Pamela Dragoshfd307be2018-08-28 18:10:51 -040062 <goals>
Rashmi Pujar7937bce2019-06-03 21:45:58 -040063 <goal>execute</goal>
Pamela Dragoshfd307be2018-08-28 18:10:51 -040064 </goals>
65 <configuration>
Rashmi Pujar7937bce2019-06-03 21:45:58 -040066 <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 Dragoshfd307be2018-08-28 18:10:51 -040081 </configuration>
82 </execution>
83 </executions>
84 </plugin>
85 <plugin>
Rashmi Pujar7937bce2019-06-03 21:45:58 -040086 <groupId>io.fabric8</groupId>
87 <artifactId>docker-maven-plugin</artifactId>
Pamela Dragoshfd307be2018-08-28 18:10:51 -040088 <configuration>
Rashmi Pujar7937bce2019-06-03 21:45:58 -040089 <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>
Rashmi Pujar7937bce2019-06-03 21:45:58 -0400146 </execution>
147 </executions>
148 </plugin>
149 <plugin>
150 <groupId>org.apache.maven.plugins</groupId>
151 <artifactId>maven-deploy-plugin</artifactId>
152 <configuration>
153 <skip>true</skip>
Pamela Dragoshfd307be2018-08-28 18:10:51 -0400154 </configuration>
155 </plugin>
Pamela Dragoshfd307be2018-08-28 18:10:51 -0400156 </plugins>
157 </build>
Rashmi Pujar7937bce2019-06-03 21:45:58 -0400158 <dependencies>
159 <dependency>
160 <groupId>${project.groupId}</groupId>
161 <artifactId>install-drools</artifactId>
162 <version>${project.version}</version>
163 <type>zip</type>
164 </dependency>
165 </dependencies>
mmis824a75e2018-03-02 18:04:48 +0000166</project>