Bump version of drools-pdp
[policy/drools-pdp.git] / packages / docker / pom.xml
1 <!--
2   ============LICENSE_START=======================================================
3   ONAP Policy Engine - Docker files
4   ================================================================================
5   Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6   Modifications Copyright (C) 2019 Bell Canada.
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
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">
23
24     <modelVersion>4.0.0</modelVersion>
25
26     <parent>
27         <groupId>org.onap.policy.drools-pdp</groupId>
28         <artifactId>packages</artifactId>
29         <version>1.5.2-SNAPSHOT</version>
30     </parent>
31
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>
36
37     <properties>
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>
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>
65                                 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']
77                                 }
78                             </source>
79                         </configuration>
80                     </execution>
81                 </executions>
82             </plugin>
83             <plugin>
84                 <groupId>io.fabric8</groupId>
85                 <artifactId>docker-maven-plugin</artifactId>
86                 <version>0.30.0</version> <!-- Extract this as a property from the policy-parent -->
87                 <configuration>
88                     <verbose>true</verbose>
89                     <apiVersion>1.23</apiVersion>
90                     <pullRegistry>${docker.pull.registry}</pullRegistry>
91                     <pushRegistry>${docker.push.registry}</pushRegistry>
92                     <images>
93                         <image>
94                             <name>onap/policy-drools</name>
95                             <build>
96                                 <cleanup>try</cleanup>
97                                 <dockerFile>Dockerfile</dockerFile>
98                                 <tags>
99                                     <tag>${project.version}</tag>
100                                     <tag>${project.version}-${maven.build.timestamp}</tag>
101                                     <tag>${project.docker.latest.minmax.tag.version}</tag>
102                                 </tags>
103                                 <assembly>
104                                     <inline>
105                                         <dependencySets>
106                                             <dependencySet>
107                                                 <includes>
108                                                     <include>org.onap.policy.drools-pdp:install-drools</include>
109                                                 </includes>
110                                                 <outputDirectory>.</outputDirectory>
111                                                 <outputFileNameMapping>install-drools.zip</outputFileNameMapping>
112                                             </dependencySet>
113                                         </dependencySets>
114                                     </inline>
115                                 </assembly>
116                             </build>
117                         </image>
118                     </images>
119                 </configuration>
120                 <executions>
121                     <execution>
122                         <id>clean-images</id>
123                         <phase>pre-clean</phase>
124                         <goals>
125                             <goal>remove</goal>
126                         </goals>
127                         <configuration>
128                             <removeAll>true</removeAll>
129                         </configuration>
130                     </execution>
131                     <execution>
132                         <id>generate-images</id>
133                         <phase>generate-sources</phase>
134                         <goals>
135                             <goal>build</goal>
136                         </goals>
137                     </execution>
138                     <execution>
139                         <id>push-images</id>
140                         <phase>deploy</phase>
141                         <goals>
142                             <goal>build</goal>
143                             <goal>push</goal>
144                         </goals>
145                         <configuration>
146                             <image>onap/policy-drools</image>
147                         </configuration>
148                     </execution>
149                 </executions>
150             </plugin>
151             <plugin>
152                 <groupId>org.apache.maven.plugins</groupId>
153                 <artifactId>maven-deploy-plugin</artifactId>
154                 <configuration>
155                     <skip>true</skip>
156                 </configuration>
157             </plugin>
158         </plugins>
159     </build>
160     <dependencies>
161         <dependency>
162             <groupId>${project.groupId}</groupId>
163             <artifactId>install-drools</artifactId>
164             <version>${project.version}</version>
165             <type>zip</type>
166         </dependency>
167     </dependencies>
168 </project>