blob: 1061bbb70e3c3d617f0190cd2fbd8342a01c3174 [file] [log] [blame]
Dan Timoneye50df7d2017-08-10 16:59:02 -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"
3 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4
5 <parent>
6 <groupId>org.onap.ccsdk.distribution</groupId>
7 <artifactId>distribution-root</artifactId>
Dan Timoney24a1a1b2017-08-21 10:27:47 -04008 <version>0.1.0-SNAPSHOT</version>
Dan Timoneye50df7d2017-08-10 16:59:02 -04009 </parent>
10
11 <modelVersion>4.0.0</modelVersion>
12 <packaging>pom</packaging>
13 <artifactId>distribution-opendaylight</artifactId>
Dan Timoney24a1a1b2017-08-21 10:27:47 -040014 <version>0.1.0-SNAPSHOT</version>
Dan Timoneye50df7d2017-08-10 16:59:02 -040015
16 <name>Distribution - opendaylight</name>
17 <description>Creates OpenDaylight container</description>
18
19 <properties>
20 <image.name>onap/ccsdk-odl-image</image.name>
21 <ccsdk.project.version>${project.version}</ccsdk.project.version>
22 <ccsdk.opendaylight.version>0.6.1-Carbon</ccsdk.opendaylight.version>
Dan Timoneyec8e4d82017-09-18 11:59:15 -040023 <ccsdk.mariadb-connector-java.version>2.1.1</ccsdk.mariadb-connector-java.version>
Dan Timoneye50df7d2017-08-10 16:59:02 -040024 <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
25 </properties>
26
27 <dependencyManagement>
28 <dependencies>
29 <dependency>
30 <groupId>org.opendaylight.integration</groupId>
31 <artifactId>distribution-karaf</artifactId>
32 <version>${ccsdk.opendaylight.version}</version>
33 <type>tar.gz</type>
34 </dependency>
35 <dependency>
Dan Timoneyec8e4d82017-09-18 11:59:15 -040036 <groupId>org.mariadb.jdbc</groupId>
37 <artifactId>mariadb-java-client</artifactId>
38 <version>${ccsdk.mariadb-connector-java.version}</version>
Dan Timoneye50df7d2017-08-10 16:59:02 -040039 <type>jar</type>
40 </dependency>
41 </dependencies>
42 </dependencyManagement>
43
44 <build>
45 <plugins>
46
47
48 <plugin>
49 <groupId>org.codehaus.groovy.maven</groupId>
50 <artifactId>gmaven-plugin</artifactId>
51 <executions>
52 <execution>
53 <phase>validate</phase>
54 <goals>
55 <goal>execute</goal>
56 </goals>
57 <configuration>
58 <source>
59 println project.properties['ccsdk.project.version'];
60 def versionArray;
Dan Timoney74e4e8d2017-08-22 11:51:54 -040061 if (project.properties['ccsdk.project.version'] != null ) {
Dan Timoneyec8e4d82017-09-18 11:59:15 -040062 versionArray = project.properties['ccsdk.project.version'].split('\\.');
Dan Timoneye50df7d2017-08-10 16:59:02 -040063 }
64
Dan Timoney74e4e8d2017-08-22 11:51:54 -040065 if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
66 {
Dan Timoneyec8e4d82017-09-18 11:59:15 -040067 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
Dan Timoneye50df7d2017-08-10 16:59:02 -040068 } else {
Dan Timoneyec8e4d82017-09-18 11:59:15 -040069 project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest";
Dan Timoneye50df7d2017-08-10 16:59:02 -040070 }
71
Dan Timoney74e4e8d2017-08-22 11:51:54 -040072 println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
Dan Timoneye50df7d2017-08-10 16:59:02 -040073 </source>
74 </configuration>
75 </execution>
76 </executions>
77 </plugin>
78
Dan Timoney74e4e8d2017-08-22 11:51:54 -040079
80
Dan Timoneye50df7d2017-08-10 16:59:02 -040081 <plugin>
Dan Timoney74e4e8d2017-08-22 11:51:54 -040082 <groupId>org.apache.maven.plugins</groupId>
83 <artifactId>maven-dependency-plugin</artifactId>
84 <version>3.0.0</version>
Dan Timoneye50df7d2017-08-10 16:59:02 -040085 <executions>
86 <execution>
Dan Timoney74e4e8d2017-08-22 11:51:54 -040087 <id>get-odl-distribution</id>
88 <phase>validate</phase>
Dan Timoneye50df7d2017-08-10 16:59:02 -040089 <goals>
Dan Timoney74e4e8d2017-08-22 11:51:54 -040090 <goal>copy</goal>
Dan Timoneye50df7d2017-08-10 16:59:02 -040091 </goals>
Dan Timoney74e4e8d2017-08-22 11:51:54 -040092 <configuration>
93 <artifactItems>
94 <artifactItem>
95 <groupId>org.opendaylight.integration</groupId>
96 <artifactId>distribution-karaf</artifactId>
97 <version>${ccsdk.opendaylight.version}</version>
98 <type>tar.gz</type>
Dan Timoneye50df7d2017-08-10 16:59:02 -040099
Dan Timoney74e4e8d2017-08-22 11:51:54 -0400100 <overWrite>true</overWrite>
101 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
102 </artifactItem>
103 </artifactItems>
104 <overWriteReleases>false</overWriteReleases>
105 <overWriteSnapshots>true</overWriteSnapshots>
106 <overWriteIfNewer>true</overWriteIfNewer>
107 </configuration>
Dan Timoneye50df7d2017-08-10 16:59:02 -0400108 </execution>
109 </executions>
110 </plugin>
111
Dan Timoneye50df7d2017-08-10 16:59:02 -0400112 <plugin>
113 <groupId>org.apache.maven.plugins</groupId>
114 <artifactId>maven-dependency-plugin</artifactId>
115 <version>3.0.0</version>
116 <executions>
117 <execution>
Dan Timoneyec8e4d82017-09-18 11:59:15 -0400118 <id>get-mariadb-connector-jar</id>
Dan Timoneye50df7d2017-08-10 16:59:02 -0400119 <phase>validate</phase>
120 <goals>
121 <goal>copy</goal>
122 </goals>
123 <configuration>
124 <artifactItems>
125 <artifactItem>
Dan Timoneyec8e4d82017-09-18 11:59:15 -0400126 <groupId>org.mariadb.jdbc</groupId>
127 <artifactId>mariadb-java-client</artifactId>
128 <version>${ccsdk.mariadb-connector-java.version}</version>
Dan Timoneye50df7d2017-08-10 16:59:02 -0400129 <type>jar</type>
Dan Timoneye50df7d2017-08-10 16:59:02 -0400130 <overWrite>true</overWrite>
131 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
132 </artifactItem>
133 </artifactItems>
134 <overWriteReleases>false</overWriteReleases>
135 <overWriteSnapshots>true</overWriteSnapshots>
136 <overWriteIfNewer>true</overWriteIfNewer>
137 </configuration>
138 </execution>
139 </executions>
140 </plugin>
141
142 <plugin>
143 <artifactId>maven-resources-plugin</artifactId>
144 <version>2.6</version>
145 <executions>
146 <execution>
147 <id>copy-dockerfile</id>
148 <goals>
149 <goal>copy-resources</goal>
150 </goals><!-- here the phase you need -->
151 <phase>validate</phase>
152 <configuration>
153 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
154 <resources>
155 <resource>
156 <directory>src/main/docker</directory>
157 <includes>
158 <include>Dockerfile</include>
159 </includes>
160 <filtering>true</filtering>
161 </resource>
162 </resources>
163 </configuration>
164 </execution>
165 </executions>
166 </plugin>
167
168
169
170 </plugins>
171
172 </build>
Dan Timoney74e4e8d2017-08-22 11:51:54 -0400173
174 <profiles>
175 <profile>
176 <id>docker</id>
177 <build>
178 <plugins>
179 <plugin>
180 <groupId>io.fabric8</groupId>
181 <artifactId>docker-maven-plugin</artifactId>
182 <version>0.16.5</version>
183 <inherited>false</inherited>
184 <configuration>
185 <images>
186 <image>
187 <name>${image.name}</name>
188 <build>
189 <cleanup>try</cleanup>
190 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
191 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
192 <tags>
193 <tag>${project.version}</tag>
194 <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
195 <tag>${project.docker.latesttag.version}</tag>
196 </tags>
197 </build>
198 </image>
199 </images>
200 </configuration>
201 <executions>
202 <execution>
203 <id>generate-images</id>
204 <phase>package</phase>
205 <goals>
206 <goal>build</goal>
207 </goals>
208 </execution>
209
210 <execution>
211 <id>push-images</id>
212 <phase>deploy</phase>
213 <goals>
214 <goal>build</goal>
215 <goal>push</goal>
216 </goals>
217 </execution>
218 </executions>
219 </plugin>
220
221 </plugins>
222 </build>
223 </profile>
224
225 </profiles>
Dan Timoneye50df7d2017-08-10 16:59:02 -0400226 <organization>
227 <name>openECOMP</name>
228 </organization>
229</project>