blob: 685e710e0842bb58ce339ac90da2eb1570e81710 [file] [log] [blame]
Patrick Bradyf92128c2018-03-15 17:52:35 -04001<?xml version="1.0" encoding="UTF-8"?>
2<!--
3============LICENSE_START==========================================
4ONAP : APPC
5===================================================================
6Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
7===================================================================
8
9Unless otherwise specified, all software contained herein is licensed
10under the Apache License, Version 2.0 (the License);
11you may not use this software except in compliance with the License.
12You may obtain a copy of the License at
13
14 http://www.apache.org/licenses/LICENSE-2.0
15
16Unless required by applicable law or agreed to in writing, software
17distributed under the License is distributed on an "AS IS" BASIS,
18WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19See the License for the specific language governing permissions and
20limitations under the License.
21
22============LICENSE_END============================================
23-->
24<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
25 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
26
27 <parent>
28 <groupId>org.onap.appc.deployment</groupId>
29 <artifactId>appc-docker-project</artifactId>
Patrick Bradyab98e982020-01-15 12:44:54 -080030 <version>1.7.1-SNAPSHOT</version>
Patrick Bradyf92128c2018-03-15 17:52:35 -040031 </parent>
32
33 <modelVersion>4.0.0</modelVersion>
34 <packaging>pom</packaging>
35 <groupId>org.onap.appc.deployment</groupId>
36 <artifactId>installation-cdt</artifactId>
Patrick Bradyab98e982020-01-15 12:44:54 -080037 <version>1.7.1-SNAPSHOT</version>
Patrick Bradyf92128c2018-03-15 17:52:35 -040038
39 <name>Installation - CDT Docker</name>
40 <description>Creates APPC CDT Docker container</description>
41
42 <properties>
43 <image.name>onap/appc-cdt-image</image.name>
Patrick Brady8c46a7f2020-01-15 12:35:46 -080044 <appc.release.version>1.7.0</appc.release.version>
Patrick Bradyab98e982020-01-15 12:44:54 -080045 <appc.snapshot.version>1.7.1-SNAPSHOT</appc.snapshot.version>
Patrick Bradyf92128c2018-03-15 17:52:35 -040046 <!--This version will be over-ridden by jenkins
47 injecting the version.properties variable file during docker build-->
48 <appc.docker.staging.version>1.0.0</appc.docker.staging.version>
Jessica Wagantallb4b8bc42018-04-04 18:28:53 -070049 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
Patrick Bradyf92128c2018-03-15 17:52:35 -040050 </properties>
51
52
53 <build>
54 <plugins>
55
56 <!-- This is to add any extra scripts, sql dump files, properties files APPC may need even after inheriting from the sdnc base image -->
57 <plugin>
58 <artifactId>maven-resources-plugin</artifactId>
59 <version>2.6</version>
60 <executions>
61 <execution>
62 <id>copy-dockerfile</id>
63 <goals>
64 <goal>copy-resources</goal>
65 </goals><!-- here the phase you need -->
66 <phase>validate</phase>
67 <configuration>
68 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
69 <resources>
70 <resource>
71 <directory>src/main/docker</directory>
72 <includes>
73 <include>Dockerfile</include>
74 </includes>
75 <filtering>true</filtering>
76 </resource>
77 </resources>
78 </configuration>
79 </execution>
Patrick Brady27525d82018-05-29 14:08:46 -070080 <execution>
Patrick Bradyf92128c2018-03-15 17:52:35 -040081 <id>copy-scripts</id>
82 <goals>
83 <goal>copy-resources</goal>
84 </goals>
85 <phase>validate</phase>
86 <configuration>
Patrick Brady27525d82018-05-29 14:08:46 -070087 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
Patrick Bradyf92128c2018-03-15 17:52:35 -040088 <resources>
89 <resource>
90 <directory>src/main/scripts</directory>
91 <includes>
92 <include>*.sh</include>
93 </includes>
94 <filtering>false</filtering>
95 </resource>
96 </resources>
97 </configuration>
Patrick Brady27525d82018-05-29 14:08:46 -070098 </execution>
Patrick Brady365efba2019-03-20 15:36:50 -070099 <execution>
100 <id>copy-resources</id>
101 <goals>
102 <goal>copy-resources</goal>
103 </goals>
104 <phase>validate</phase>
105 <configuration>
106 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
107 <resources>
108 <resource>
109 <directory>src/main/resources</directory>
110 <includes>
111 <include>nginx.conf</include>
112 </includes>
113 <filtering>false</filtering>
114 </resource>
115 </resources>
116 </configuration>
117 </execution>
118 <execution>
119 <id>copy-certs</id>
120 <goals>
121 <goal>copy-resources</goal>
122 </goals>
123 <phase>validate</phase>
124 <configuration>
125 <outputDirectory>${basedir}/target/docker-stage/cert</outputDirectory>
126 <resources>
127 <resource>
128 <directory>src/main/resources/cert</directory>
129 <includes>
130 <include>*.pem</include>
131 </includes>
132 <filtering>false</filtering>
133 </resource>
134 </resources>
135 </configuration>
136 </execution>
Patrick Bradyf92128c2018-03-15 17:52:35 -0400137 </executions>
138 </plugin>
139 <plugin>
140 <artifactId>exec-maven-plugin</artifactId>
141 <groupId>org.codehaus.mojo</groupId>
142 <version>1.5.0</version>
143 <executions>
144 <execution>
145 <id>Get features</id>
146 <phase>generate-sources</phase>
147 <goals>
148 <goal>exec</goal>
149 </goals>
150 <configuration>
151 <executable>bash</executable>
152 <environmentVariables>
153 <APPC_VERSION>${appc.version}</APPC_VERSION>
154 <APPC_OAM_VERSION>${project.version}</APPC_OAM_VERSION>
155 <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION>
156 </environmentVariables>
157 <arguments>
158 <argument>${basedir}/src/main/scripts/installZips.sh</argument>
159 <argument>${basedir}/target/docker-stage</argument>
160 </arguments>
161 </configuration>
162 </execution>
163
164 </executions>
165 </plugin>
166 </plugins>
167 </build>
168
169 <profiles>
170 <profile>
171 <id>docker</id>
172 <build>
173 <plugins>
174 <plugin>
175 <groupId>org.codehaus.groovy.maven</groupId>
176 <artifactId>gmaven-plugin</artifactId>
177 <executions>
178 <execution>
179 <phase>validate</phase>
180 <goals>
181 <goal>execute</goal>
182 </goals>
183 <configuration>
184 <properties>
185 <ver>${project.version}</ver>
186 <timestamp>${maven.build.timestamp}</timestamp>
187 </properties>
188 <source>
189 println project.properties['ver'];
190 def versionArray;
191 if ( project.properties['ver'] != null ) {
192 versionArray = project.properties['ver'].split('\\.');
193 }
194 if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
195 project.properties['dockertag1']=project.properties['ver'] + "-latest";
Patrick Bradyd64f8402018-04-06 15:28:17 -0700196 project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp'];
Patrick Bradyf92128c2018-03-15 17:52:35 -0400197 project.properties['appc.version']=project.properties['appc.snapshot.version'];
198 } else {
199 project.properties['dockertag1']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
200 project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
201 project.properties['appc.version']=project.properties['appc.release.version'];
202 }
203 println 'docker tag 1: ' + project.properties['dockertag1'];
204 println 'docker tag 2: ' + project.properties['dockertag2'];
205 </source>
206 </configuration>
207 </execution>
208 </executions>
209 </plugin>
210 <plugin>
211 <groupId>io.fabric8</groupId>
212 <artifactId>docker-maven-plugin</artifactId>
Simon Hraboscd9e4602019-03-28 05:17:18 -0400213 <version>0.28.0</version>
Patrick Bradyf92128c2018-03-15 17:52:35 -0400214 <inherited>false</inherited>
215 <configuration>
216 <images>
217 <image>
218 <name>${image.name}</name>
219 <build>
220 <cleanup>try</cleanup>
221 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
Simon Hraboscd9e4602019-03-28 05:17:18 -0400222 <dockerFile>Dockerfile</dockerFile>
Patrick Bradyf92128c2018-03-15 17:52:35 -0400223 <tags>
224 <tag>${dockertag1}</tag>
225 <tag>${dockertag2}</tag>
226 </tags>
227 </build>
228 </image>
229 </images>
230 </configuration>
231 <executions>
232 <execution>
233 <id>generate-images</id>
234 <phase>package</phase>
235 <goals>
236 <goal>build</goal>
237 </goals>
238 </execution>
239
240 <execution>
241 <id>push-images</id>
242 <phase>deploy</phase>
243 <goals>
244 <goal>build</goal>
245 <goal>push</goal>
246 </goals>
247 </execution>
248 </executions>
249 </plugin>
250
251 <!-- This is to add any extra scripts, sql dump files, properties files
252 APPC may need even after inheriting from the sdnc base image -->
253 <plugin>
254 <artifactId>maven-resources-plugin</artifactId>
255 <version>2.6</version>
256 <executions>
257 <execution>
258 <id>copy-dockerfile</id>
259 <goals>
260 <goal>copy-resources</goal>
261 </goals><!-- here the phase you need -->
262 <phase>validate</phase>
263 <configuration>
264 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
265 <resources>
266 <resource>
267 <directory>src/main/docker</directory>
268 <includes>
269 <include>Dockerfile</include>
270 </includes>
271 <filtering>true</filtering>
272 </resource>
273 </resources>
274 </configuration>
275 </execution>
Patrick Brady27525d82018-05-29 14:08:46 -0700276 <execution>
277 <id>copy-scripts</id>
278 <goals>
279 <goal>copy-resources</goal>
280 </goals>
281 <phase>validate</phase>
282 <configuration>
283 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
284 <resources>
285 <resource>
286 <directory>src/main/scripts</directory>
287 <includes>
288 <include>*.sh</include>
289 </includes>
290 <filtering>false</filtering>
291 </resource>
292 </resources>
293 </configuration>
294 </execution>
Patrick Bradyf92128c2018-03-15 17:52:35 -0400295 </executions>
296 </plugin>
297 <plugin>
298 <artifactId>exec-maven-plugin</artifactId>
299 <groupId>org.codehaus.mojo</groupId>
300 <version>1.5.0</version>
301 <executions>
302 <execution>
303 <id>Get features</id>
304 <phase>generate-sources</phase>
305 <goals>
306 <goal>exec</goal>
307 </goals>
308 <configuration>
309 <executable>bash</executable>
310 <environmentVariables>
311 <APPC_VERSION>${appc.version}</APPC_VERSION>
312 <APPC_OAM_VERSION>${project.version}</APPC_OAM_VERSION>
313 <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION>
314 </environmentVariables>
315 <arguments>
316 <argument>${basedir}/src/main/scripts/installZips.sh</argument>
317 <argument>${basedir}/target/docker-stage</argument>
318 <argument>${basedir}/target/docker-stage</argument>
319 </arguments>
320 </configuration>
321 </execution>
322
323
324 </executions>
325 </plugin>
326 </plugins>
327 </build>
328
329 </profile>
330 </profiles>
331
332 <organization>
333 <name>ONAP</name>
334 </organization>
335
336</project>