Dan Timoney | 73be211 | 2017-08-09 13:37:32 -0400 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
Dan Timoney | 912f98b | 2018-02-27 14:10:22 -0500 | [diff] [blame] | 2 | <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"> |
| 3 | <modelVersion>4.0.0</modelVersion> |
Dan Timoney | 73be211 | 2017-08-09 13:37:32 -0400 | [diff] [blame] | 4 | |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 5 | <parent> |
| 6 | <groupId>org.onap.ccsdk.distribution</groupId> |
| 7 | <artifactId>distribution-root</artifactId> |
Timoney, Dan (dt5972) | e7cfae5 | 2019-01-03 15:14:58 -0500 | [diff] [blame^] | 8 | <version>0.4.1-SNAPSHOT</version> |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 9 | </parent> |
Dan Timoney | 73be211 | 2017-08-09 13:37:32 -0400 | [diff] [blame] | 10 | |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 11 | <artifactId>distribution-ubuntu</artifactId> |
Timoney, Dan (dt5972) | e7cfae5 | 2019-01-03 15:14:58 -0500 | [diff] [blame^] | 12 | <version>0.4.1-SNAPSHOT</version> |
Dan Timoney | 912f98b | 2018-02-27 14:10:22 -0500 | [diff] [blame] | 13 | <packaging>pom</packaging> |
Dan Timoney | 73be211 | 2017-08-09 13:37:32 -0400 | [diff] [blame] | 14 | |
Dan Timoney | 912f98b | 2018-02-27 14:10:22 -0500 | [diff] [blame] | 15 | <name>ccsdk-distribution :: ubuntu</name> |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 16 | <description>Creates base ubuntu Docker container</description> |
Dan Timoney | 912f98b | 2018-02-27 14:10:22 -0500 | [diff] [blame] | 17 | <organization> |
| 18 | <name>openECOMP</name> |
| 19 | </organization> |
Dan Timoney | 73be211 | 2017-08-09 13:37:32 -0400 | [diff] [blame] | 20 | |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 21 | <properties> |
| 22 | <image.name>onap/ccsdk-ubuntu-image</image.name> |
| 23 | <ccsdk.project.version>${project.version}</ccsdk.project.version> |
| 24 | </properties> |
Dan Timoney | 73be211 | 2017-08-09 13:37:32 -0400 | [diff] [blame] | 25 | |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 26 | <build> |
| 27 | <plugins> |
Dan Timoney | 73be211 | 2017-08-09 13:37:32 -0400 | [diff] [blame] | 28 | |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 29 | <plugin> |
| 30 | <groupId>org.codehaus.groovy.maven</groupId> |
| 31 | <artifactId>gmaven-plugin</artifactId> |
| 32 | <executions> |
| 33 | <execution> |
| 34 | <phase>validate</phase> |
| 35 | <goals> |
| 36 | <goal>execute</goal> |
| 37 | </goals> |
| 38 | <configuration> |
| 39 | <source> |
| 40 | println project.properties['ccsdk.project.version']; |
| 41 | def versionArray; |
| 42 | if ( project.properties['ccsdk.project.version'] != null ) { |
| 43 | versionArray = project.properties['ccsdk.project.version'].split('\\.'); |
| 44 | } |
Dan Timoney | 73be211 | 2017-08-09 13:37:32 -0400 | [diff] [blame] | 45 | |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 46 | if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) |
| 47 | { |
| 48 | project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; |
| 49 | } else { |
| 50 | project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; |
| 51 | } |
Dan Timoney | 73be211 | 2017-08-09 13:37:32 -0400 | [diff] [blame] | 52 | |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 53 | println 'New Tag for docker:' + |
| 54 | project.properties['project.docker.latesttag.version']; |
| 55 | </source> |
| 56 | </configuration> |
| 57 | </execution> |
| 58 | </executions> |
| 59 | </plugin> |
Dan Timoney | 73be211 | 2017-08-09 13:37:32 -0400 | [diff] [blame] | 60 | |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 61 | <plugin> |
| 62 | <artifactId>maven-resources-plugin</artifactId> |
| 63 | <version>2.6</version> |
| 64 | <executions> |
| 65 | <execution> |
| 66 | <id>copy-dockerfile</id> |
| 67 | <goals> |
| 68 | <goal>copy-resources</goal> |
| 69 | </goals><!-- here the phase you need --> |
| 70 | <phase>validate</phase> |
| 71 | <configuration> |
| 72 | <outputDirectory>${basedir}/target/docker-stage</outputDirectory> |
| 73 | <resources> |
| 74 | <resource> |
| 75 | <directory>src/main/docker</directory> |
| 76 | <includes> |
| 77 | <include>Dockerfile</include> |
| 78 | </includes> |
| 79 | <filtering>true</filtering> |
| 80 | </resource> |
| 81 | </resources> |
| 82 | </configuration> |
| 83 | </execution> |
| 84 | </executions> |
| 85 | </plugin> |
| 86 | </plugins> |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 87 | </build> |
Dan Timoney | 73be211 | 2017-08-09 13:37:32 -0400 | [diff] [blame] | 88 | |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 89 | <profiles> |
| 90 | <profile> |
| 91 | <id>docker</id> |
| 92 | <build> |
| 93 | <plugins> |
| 94 | <plugin> |
| 95 | <groupId>io.fabric8</groupId> |
| 96 | <artifactId>docker-maven-plugin</artifactId> |
Timoney, Dan (dt5972) | b1ac725 | 2018-12-14 13:00:43 -0500 | [diff] [blame] | 97 | <version>0.26.0</version> |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 98 | <inherited>false</inherited> |
| 99 | <configuration> |
Dan Timoney | 73be211 | 2017-08-09 13:37:32 -0400 | [diff] [blame] | 100 | |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 101 | <images> |
| 102 | <image> |
| 103 | <name>${image.name}</name> |
| 104 | <build> |
| 105 | <cleanup>try</cleanup> |
| 106 | <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir> |
Timoney, Dan (dt5972) | b1ac725 | 2018-12-14 13:00:43 -0500 | [diff] [blame] | 107 | <dockerFile>Dockerfile</dockerFile> |
Dan Timoney | 74e4e8d | 2017-08-22 11:51:54 -0400 | [diff] [blame] | 108 | <tags> |
| 109 | <tag>${project.version}</tag> |
| 110 | <tag>${project.version}-STAGING-${maven.build.timestamp}</tag> |
| 111 | <tag>${project.docker.latesttag.version}</tag> |
| 112 | </tags> |
| 113 | </build> |
| 114 | </image> |
| 115 | </images> |
| 116 | </configuration> |
| 117 | <executions> |
| 118 | <execution> |
| 119 | <id>generate-images</id> |
| 120 | <phase>generate-sources</phase> |
| 121 | <goals> |
| 122 | <goal>build</goal> |
| 123 | </goals> |
| 124 | </execution> |
| 125 | |
| 126 | <execution> |
| 127 | <id>push-images</id> |
| 128 | <phase>deploy</phase> |
| 129 | <goals> |
| 130 | <goal>build</goal> |
| 131 | <goal>push</goal> |
| 132 | </goals> |
| 133 | </execution> |
| 134 | </executions> |
| 135 | </plugin> |
| 136 | |
| 137 | </plugins> |
| 138 | </build> |
| 139 | </profile> |
| 140 | </profiles> |
Dan Timoney | 73be211 | 2017-08-09 13:37:32 -0400 | [diff] [blame] | 141 | </project> |