Bump versions in policy/engine master
[policy/engine.git] / packages / docker / pom.xml
1 <!--
2   ============LICENSE_START=======================================================
3   ONAP Policy Engine - Docker files
4   ================================================================================
5   Copyright (C) 2017 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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
23     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24
25     <modelVersion>4.0.0</modelVersion>
26
27     <parent>
28         <groupId>org.onap.policy.engine</groupId>
29         <artifactId>packages</artifactId>
30         <version>1.6.0-SNAPSHOT</version>
31     </parent>
32
33     <artifactId>docker</artifactId>
34     <packaging>pom</packaging>
35     <name>Policy Engine - Docker build</name>
36     <description>ONAP Policy Docker Build</description>
37
38     <properties>
39         <nexusproxy>https://nexus.onap.org</nexusproxy>
40         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
41         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
42         <dist.project.version>${project.version}</dist.project.version>
43         <docker.skip>false</docker.skip>
44         <docker.skip.build>false</docker.skip.build>
45         <docker.skip.push>false</docker.skip.push>
46         <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
47         <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
48         <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
49     </properties>
50
51     <build>
52         <finalName>${project.artifactId}-${project.version}</finalName>
53         <plugins>
54             <plugin>
55                 <groupId>org.codehaus.groovy.maven</groupId>
56                 <artifactId>gmaven-plugin</artifactId>
57                 <version>1.0</version>
58                 <executions>
59                     <execution>
60                         <phase>validate</phase>
61                         <goals>
62                             <goal>execute</goal>
63                         </goals>
64                         <configuration>
65                             <source>
66                                 println 'Project version: ' + project.properties['dist.project.version']
67                                 if (project.properties['dist.project.version'] != null) {
68                                     def versionArray = project.properties['dist.project.version'].split('-')
69                                     def minMaxVersionArray = versionArray[0].tokenize('.')
70                                     if (project.properties['dist.project.version'].endsWith("-SNAPSHOT")) {
71                                         project.properties['project.docker.latest.minmax.tag.version'] =
72                                             minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-SNAPSHOT-latest"
73                                     } else {
74                                         project.properties['project.docker.latest.minmax.tag.version'] =
75                                             minMaxVersionArray[0] + "." + minMaxVersionArray[1] + "-STAGING-latest"
76                                     }
77                                     println 'New tag for docker: ' + project.properties['project.docker.latest.minmax.tag.version']
78                                 }
79                             </source>
80                         </configuration>
81                     </execution>
82                 </executions>
83             </plugin>
84             <plugin>
85                 <groupId>io.fabric8</groupId>
86                 <artifactId>docker-maven-plugin</artifactId>
87                 <version>0.30.0</version> <!-- Extract this as a property from the policy-parent -->
88                 <configuration>
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-pe</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.engine:install</include>
110                                                 </includes>
111                                                 <outputDirectory>.</outputDirectory>
112                                                 <outputFileNameMapping>install.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-pe</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>
157                 </configuration>
158             </plugin>
159         </plugins>
160     </build>
161     <dependencies>
162         <dependency>
163             <groupId>${project.groupId}</groupId>
164             <artifactId>install</artifactId>
165             <version>${project.version}</version>
166             <type>zip</type>
167         </dependency>
168     </dependencies>
169 </project>