blob: 302364cd054ff6bf2cb7f812317d91e87ecb96bd [file] [log] [blame]
Dmitry Puzikov7830af02019-03-27 13:55:13 +01001<!--
2 ============LICENSE_START=======================================================
Dmitry Puzikovc8e918d2019-04-02 10:05:05 +02003 Copyright (C) 2019 Ericsson, Tieto. All rights reserved.
Jim Hahn0fe23332020-01-13 16:36:38 -05004 Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
Dmitry Puzikov7830af02019-03-27 13:55:13 +01005 ================================================================================
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-->
21
22<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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.docker</groupId>
Jim Hahn0fe23332020-01-13 16:36:38 -050029 <artifactId>policy-jre</artifactId>
Paul Vaduva4da9d442019-06-27 18:00:57 +020030 <version>2.0.0-SNAPSHOT</version>
Dmitry Puzikov7830af02019-03-27 13:55:13 +010031 </parent>
32
33 <packaging>pom</packaging>
Jim Hahn0fe23332020-01-13 16:36:38 -050034 <artifactId>policy-jre-alpine</artifactId>
35 <name>Policy alpine jre docker image</name>
36 <description>Policy alpine jre docker image</description>
Dmitry Puzikov7830af02019-03-27 13:55:13 +010037
38 <build>
39 <finalName>${project.artifactId}-${project.version}</finalName>
40 <plugins>
41 <plugin>
42 <groupId>org.codehaus.groovy.maven</groupId>
43 <artifactId>gmaven-plugin</artifactId>
44 <version>1.0</version>
45 <executions>
46 <execution>
Paul Vaduva4da9d442019-06-27 18:00:57 +020047 <phase>pre-clean</phase>
Dmitry Puzikov7830af02019-03-27 13:55:13 +010048 <goals>
49 <goal>execute</goal>
50 </goals>
51 <configuration>
52 <source>
53 println 'Project version: ' + project.properties['dist.project.version'];
54 def versionArray;
55 if ( project.properties['dist.project.version'] != null ) {
56 versionArray = project.properties['dist.project.version'].split('-');
57 }
58
59 if ( project.properties['dist.project.version'].endsWith("-SNAPSHOT") ) {
60 project.properties['project.docker.latesttag.version']=versionArray[0] + "-SNAPSHOT-latest";
61 } else {
62 project.properties['project.docker.latesttag.version']=versionArray[0] + "-STAGING-latest";
63 }
64
65 println 'New tag for docker: ' + project.properties['project.docker.latesttag.version'];
Paul Vaduva4da9d442019-06-27 18:00:57 +020066 if ( "aarch64".equals(System.properties['os.arch']) ) {
67 project.properties['project.docker.arch'] = "arm64";
68 } else {
69 project.properties['project.docker.arch'] = System.properties['os.arch'];
70 }
71 println 'Using arch for docker: ' + project.properties['project.docker.arch'];
Dmitry Puzikov7830af02019-03-27 13:55:13 +010072 </source>
73 </configuration>
74 </execution>
75 </executions>
76 </plugin>
77 <plugin>
78 <groupId>io.fabric8</groupId>
79 <artifactId>docker-maven-plugin</artifactId>
Jim Hahn0fe23332020-01-13 16:36:38 -050080
Dmitry Puzikov7830af02019-03-27 13:55:13 +010081 <configuration>
82 <verbose>true</verbose>
83 <apiVersion>1.23</apiVersion>
84 <pullRegistry>${docker.pull.registry}</pullRegistry>
85 <pushRegistry>${docker.push.registry}</pushRegistry>
Dmitry Puzikov7830af02019-03-27 13:55:13 +010086 <images>
87 <image>
Jim Hahn0fe23332020-01-13 16:36:38 -050088 <name>onap/policy-jre-alpine:latest-${project.docker.arch}</name>
Dmitry Puzikov7830af02019-03-27 13:55:13 +010089 <build>
90 <cleanup>try</cleanup>
91 <dockerFile>Dockerfile</dockerFile>
92 <tags>
Paul Vaduva4da9d442019-06-27 18:00:57 +020093 <tag>${project.version}-${project.docker.arch}</tag>
94 <tag>${project.docker.latesttag.version}-${project.docker.arch}</tag>
Dmitry Puzikov7830af02019-03-27 13:55:13 +010095 </tags>
Dmitry Puzikovc8e918d2019-04-02 10:05:05 +020096 <args>
97 <BUILD_VERSION>${docker.build.version}</BUILD_VERSION>
98 </args>
Dmitry Puzikov7830af02019-03-27 13:55:13 +010099 </build>
100 </image>
101 </images>
102 </configuration>
103
104 <executions>
105 <execution>
106 <id>clean-images</id>
107 <phase>pre-clean</phase>
108 <goals>
109 <goal>remove</goal>
110 </goals>
111 <configuration>
112 <removeAll>true</removeAll>
113 </configuration>
114 </execution>
115
116 <execution>
117 <id>generate-images</id>
118 <phase>generate-sources</phase>
119 <goals>
120 <goal>build</goal>
121 </goals>
122 </execution>
123
124 <execution>
125 <id>push-images</id>
126 <phase>deploy</phase>
127 <goals>
128 <goal>build</goal>
129 <goal>push</goal>
130 </goals>
131 <configuration>
Jim Hahn0fe23332020-01-13 16:36:38 -0500132 <image>onap/policy-jre-alpine</image>
Dmitry Puzikov7830af02019-03-27 13:55:13 +0100133 </configuration>
134 </execution>
135 </executions>
136 </plugin>
137 <plugin>
138 <groupId>org.apache.maven.plugins</groupId>
139 <artifactId>maven-deploy-plugin</artifactId>
140 <configuration>
141 <skip>true</skip>
142 </configuration>
143 </plugin>
144 <plugin>
145 <groupId>org.apache.maven.plugins</groupId>
146 <artifactId>maven-install-plugin</artifactId>
147 <configuration>
148 <skip>true</skip>
149 </configuration>
150 </plugin>
151 </plugins>
152 </build>
153</project>
154