blob: caf26acf219c507dabb1d179ea7b55aa1bfe0b71 [file] [log] [blame]
Dan Timoney73be2112017-08-09 13:37:32 -04001<?xml version="1.0" encoding="UTF-8"?>
2<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Dan Timoney74e4e8d2017-08-22 11:51:54 -04003 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
Dan Timoney73be2112017-08-09 13:37:32 -04004
Dan Timoney74e4e8d2017-08-22 11:51:54 -04005 <parent>
6 <groupId>org.onap.ccsdk.distribution</groupId>
7 <artifactId>distribution-root</artifactId>
Jessica Wagantall80561d22017-11-16 22:58:09 -08008 <version>0.1.1-SNAPSHOT</version>
Dan Timoney74e4e8d2017-08-22 11:51:54 -04009 </parent>
Dan Timoney73be2112017-08-09 13:37:32 -040010
Dan Timoney74e4e8d2017-08-22 11:51:54 -040011 <modelVersion>4.0.0</modelVersion>
12 <packaging>pom</packaging>
13 <artifactId>distribution-ubuntu</artifactId>
Jessica Wagantall80561d22017-11-16 22:58:09 -080014 <version>0.1.1-SNAPSHOT</version>
Dan Timoney73be2112017-08-09 13:37:32 -040015
Dan Timoney74e4e8d2017-08-22 11:51:54 -040016 <name>Distribution - ubuntu</name>
17 <description>Creates base ubuntu Docker container</description>
Dan Timoney73be2112017-08-09 13:37:32 -040018
Dan Timoney74e4e8d2017-08-22 11:51:54 -040019 <properties>
20 <image.name>onap/ccsdk-ubuntu-image</image.name>
21 <ccsdk.project.version>${project.version}</ccsdk.project.version>
22 </properties>
Dan Timoney73be2112017-08-09 13:37:32 -040023
24
Dan Timoney74e4e8d2017-08-22 11:51:54 -040025 <build>
26 <plugins>
Dan Timoney73be2112017-08-09 13:37:32 -040027
Dan Timoney74e4e8d2017-08-22 11:51:54 -040028 <plugin>
29 <groupId>org.codehaus.groovy.maven</groupId>
30 <artifactId>gmaven-plugin</artifactId>
31 <executions>
32 <execution>
33 <phase>validate</phase>
34 <goals>
35 <goal>execute</goal>
36 </goals>
37 <configuration>
38 <source>
39 println project.properties['ccsdk.project.version'];
40 def versionArray;
41 if ( project.properties['ccsdk.project.version'] != null ) {
42 versionArray = project.properties['ccsdk.project.version'].split('\\.');
43 }
Dan Timoney73be2112017-08-09 13:37:32 -040044
Jessica Wagantall80561d22017-11-16 22:58:09 -080045 if (project.properties['ccsdk.project.version'].endsWith("-amsterdam"))
Dan Timoney74e4e8d2017-08-22 11:51:54 -040046 {
47 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
48 } else {
49 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
50 }
Dan Timoney73be2112017-08-09 13:37:32 -040051
Dan Timoney74e4e8d2017-08-22 11:51:54 -040052 println 'New Tag for docker:' +
53 project.properties['project.docker.latesttag.version'];
54 </source>
55 </configuration>
56 </execution>
57 </executions>
58 </plugin>
Dan Timoney73be2112017-08-09 13:37:32 -040059
Dan Timoney74e4e8d2017-08-22 11:51:54 -040060 <plugin>
61 <artifactId>maven-resources-plugin</artifactId>
62 <version>2.6</version>
63 <executions>
64 <execution>
65 <id>copy-dockerfile</id>
66 <goals>
67 <goal>copy-resources</goal>
68 </goals><!-- here the phase you need -->
69 <phase>validate</phase>
70 <configuration>
71 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
72 <resources>
73 <resource>
74 <directory>src/main/docker</directory>
75 <includes>
76 <include>Dockerfile</include>
77 </includes>
78 <filtering>true</filtering>
79 </resource>
80 </resources>
81 </configuration>
82 </execution>
83 </executions>
84 </plugin>
85 </plugins>
Dan Timoney73be2112017-08-09 13:37:32 -040086
Dan Timoney74e4e8d2017-08-22 11:51:54 -040087 </build>
Dan Timoney73be2112017-08-09 13:37:32 -040088
Dan Timoney74e4e8d2017-08-22 11:51:54 -040089 <profiles>
90 <profile>
91 <id>docker</id>
92 <build>
93 <plugins>
94 <plugin>
95 <groupId>io.fabric8</groupId>
96 <artifactId>docker-maven-plugin</artifactId>
97 <version>0.16.5</version>
98 <inherited>false</inherited>
99 <configuration>
Dan Timoney73be2112017-08-09 13:37:32 -0400100
Dan Timoney74e4e8d2017-08-22 11:51:54 -0400101 <images>
102 <image>
103 <name>${image.name}</name>
104 <build>
105 <cleanup>try</cleanup>
106 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
107 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
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>
141 <organization>
142 <name>openECOMP</name>
143 </organization>
Dan Timoney73be2112017-08-09 13:37:32 -0400144</project>