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-jdk</artifactId> |
Jim Hahn | 539bf44 | 2021-02-22 17:17:22 -0500 | [diff] [blame] | 30 | <version>2.2.2-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-jdk-alpine</artifactId> |
| 35 | <name>Policy alpine jdk docker image</name> |
| 36 | <description>Policy alpine jdk 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> |
RossC | 3d168b0 | 2020-06-16 11:41:49 +0100 | [diff] [blame] | 47 | <phase>validate</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']; |
| 66 | </source> |
| 67 | </configuration> |
| 68 | </execution> |
| 69 | </executions> |
| 70 | </plugin> |
| 71 | <plugin> |
| 72 | <groupId>io.fabric8</groupId> |
| 73 | <artifactId>docker-maven-plugin</artifactId> |
Jim Hahn | 0fe2333 | 2020-01-13 16:36:38 -0500 | [diff] [blame] | 74 | |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 75 | <configuration> |
| 76 | <verbose>true</verbose> |
| 77 | <apiVersion>1.23</apiVersion> |
| 78 | <pullRegistry>${docker.pull.registry}</pullRegistry> |
| 79 | <pushRegistry>${docker.push.registry}</pushRegistry> |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 80 | <images> |
| 81 | <image> |
RossC | 3d168b0 | 2020-06-16 11:41:49 +0100 | [diff] [blame] | 82 | <name>onap/policy-jdk-alpine</name> |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 83 | <build> |
| 84 | <cleanup>try</cleanup> |
| 85 | <dockerFile>Dockerfile</dockerFile> |
| 86 | <tags> |
RossC | 3d168b0 | 2020-06-16 11:41:49 +0100 | [diff] [blame] | 87 | <tag>${project.version}</tag> |
| 88 | <tag>${project.version}-${maven.build.timestamp}</tag> |
| 89 | <tag>${project.docker.latesttag.version}</tag> |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 90 | </tags> |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 91 | </build> |
| 92 | </image> |
| 93 | </images> |
| 94 | </configuration> |
| 95 | |
| 96 | <executions> |
| 97 | <execution> |
| 98 | <id>clean-images</id> |
| 99 | <phase>pre-clean</phase> |
| 100 | <goals> |
| 101 | <goal>remove</goal> |
| 102 | </goals> |
| 103 | <configuration> |
| 104 | <removeAll>true</removeAll> |
| 105 | </configuration> |
| 106 | </execution> |
| 107 | |
| 108 | <execution> |
| 109 | <id>generate-images</id> |
| 110 | <phase>generate-sources</phase> |
| 111 | <goals> |
| 112 | <goal>build</goal> |
| 113 | </goals> |
| 114 | </execution> |
| 115 | |
| 116 | <execution> |
| 117 | <id>push-images</id> |
| 118 | <phase>deploy</phase> |
| 119 | <goals> |
| 120 | <goal>build</goal> |
| 121 | <goal>push</goal> |
| 122 | </goals> |
| 123 | <configuration> |
Jim Hahn | 0fe2333 | 2020-01-13 16:36:38 -0500 | [diff] [blame] | 124 | <image>onap/policy-jdk-alpine</image> |
Dmitry Puzikov | 7830af0 | 2019-03-27 13:55:13 +0100 | [diff] [blame] | 125 | </configuration> |
| 126 | </execution> |
| 127 | </executions> |
| 128 | </plugin> |
| 129 | <plugin> |
| 130 | <groupId>org.apache.maven.plugins</groupId> |
| 131 | <artifactId>maven-deploy-plugin</artifactId> |
| 132 | <configuration> |
| 133 | <skip>true</skip> |
| 134 | </configuration> |
| 135 | </plugin> |
| 136 | <plugin> |
| 137 | <groupId>org.apache.maven.plugins</groupId> |
| 138 | <artifactId>maven-install-plugin</artifactId> |
| 139 | <configuration> |
| 140 | <skip>true</skip> |
| 141 | </configuration> |
| 142 | </plugin> |
| 143 | </plugins> |
| 144 | </build> |
| 145 | </project> |