Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 1 | <!-- |
| 2 | ============LICENSE_START======================================================= |
Dmitry Puzikov | c8e918d | 2019-04-02 10:05:05 +0200 | [diff] [blame] | 3 | Copyright (C) 2019 Ericsson, Tieto. All rights reserved. |
Jim Hahn | 0fe2333 | 2020-01-13 16:36:38 -0500 | [diff] [blame^] | 4 | Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 5 | ================================================================================ |
| 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 Hahn | 0fe2333 | 2020-01-13 16:36:38 -0500 | [diff] [blame^] | 29 | <artifactId>policy-jre</artifactId> |
Paul Vaduva | 4da9d44 | 2019-06-27 18:00:57 +0200 | [diff] [blame] | 30 | <version>2.0.0-SNAPSHOT</version> |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 31 | </parent> |
| 32 | |
| 33 | <packaging>pom</packaging> |
Jim Hahn | 0fe2333 | 2020-01-13 16:36:38 -0500 | [diff] [blame^] | 34 | <artifactId>policy-jre-alpine</artifactId> |
| 35 | <name>Policy alpine jre docker image</name> |
| 36 | <description>Policy alpine jre docker image</description> |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 37 | |
| 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 Vaduva | 4da9d44 | 2019-06-27 18:00:57 +0200 | [diff] [blame] | 47 | <phase>pre-clean</phase> |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 48 | <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 Vaduva | 4da9d44 | 2019-06-27 18:00:57 +0200 | [diff] [blame] | 66 | 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 Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 72 | </source> |
| 73 | </configuration> |
| 74 | </execution> |
| 75 | </executions> |
| 76 | </plugin> |
| 77 | <plugin> |
| 78 | <groupId>io.fabric8</groupId> |
| 79 | <artifactId>docker-maven-plugin</artifactId> |
Jim Hahn | 0fe2333 | 2020-01-13 16:36:38 -0500 | [diff] [blame^] | 80 | |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 81 | <configuration> |
| 82 | <verbose>true</verbose> |
| 83 | <apiVersion>1.23</apiVersion> |
| 84 | <pullRegistry>${docker.pull.registry}</pullRegistry> |
| 85 | <pushRegistry>${docker.push.registry}</pushRegistry> |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 86 | <images> |
| 87 | <image> |
Jim Hahn | 0fe2333 | 2020-01-13 16:36:38 -0500 | [diff] [blame^] | 88 | <name>onap/policy-jre-alpine:latest-${project.docker.arch}</name> |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 89 | <build> |
| 90 | <cleanup>try</cleanup> |
| 91 | <dockerFile>Dockerfile</dockerFile> |
| 92 | <tags> |
Paul Vaduva | 4da9d44 | 2019-06-27 18:00:57 +0200 | [diff] [blame] | 93 | <tag>${project.version}-${project.docker.arch}</tag> |
| 94 | <tag>${project.docker.latesttag.version}-${project.docker.arch}</tag> |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 95 | </tags> |
Dmitry Puzikov | c8e918d | 2019-04-02 10:05:05 +0200 | [diff] [blame] | 96 | <args> |
| 97 | <BUILD_VERSION>${docker.build.version}</BUILD_VERSION> |
| 98 | </args> |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 99 | </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 Hahn | 0fe2333 | 2020-01-13 16:36:38 -0500 | [diff] [blame^] | 132 | <image>onap/policy-jre-alpine</image> |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 133 | </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 | |