af790f023d44d44c6e4333c827cb6f9aabf2af60
[appc/deployment.git] / installation / appc / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 ============LICENSE_START==========================================
4 ONAP : APPC
5 ===================================================================
6 Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
7 ===================================================================
8
9 Unless otherwise specified, all software contained herein is licensed
10 under the Apache License, Version 2.0 (the License);
11 you may not use this software except in compliance with the License.
12 You may obtain a copy of the License at
13
14     http://www.apache.org/licenses/LICENSE-2.0
15
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
21
22 ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 ============LICENSE_END============================================
24 -->
25 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
26         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
27
28         <parent>
29                 <groupId>org.onap.appc.deployment</groupId>
30                 <artifactId>installation</artifactId>
31                 <version>1.3.0-SNAPSHOT</version>
32         </parent>
33
34         <modelVersion>4.0.0</modelVersion>
35         <packaging>pom</packaging>
36         <groupId>org.onap.appc.deployment</groupId>
37         <artifactId>installation-appc</artifactId>
38         <version>1.3.0-SNAPSHOT</version>
39
40         <name>Installation - APPC Docker</name>
41         <description>Creates APPC Docker container on top of the SDNC Base Docker Image</description>
42
43         <properties>
44                 <image.name>onap/appc-image</image.name>
45                 <appc.release.version>1.3.0</appc.release.version>
46                 <appc.snapshot.version>1.3.0-SNAPSHOT</appc.snapshot.version>
47                 <!--This version will be over-ridden by jenkins 
48                     injecting the version.properties variable file during docker build-->
49                 <appc.docker.staging.version>1.0.0</appc.docker.staging.version>
50                 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
51         </properties>
52
53
54         <build>
55                 <plugins>
56                         
57                         <!-- This is to add any extra scripts, sql dump files, properties files APPC may need even after inheriting from the sdnc base image -->
58                         <plugin>
59                                 <artifactId>maven-resources-plugin</artifactId>
60                                 <version>2.6</version>
61                                 <executions>
62                                         <execution>
63                                                 <id>copy-dockerfile</id>
64                                                 <goals>
65                                                         <goal>copy-resources</goal>
66                                                 </goals><!-- here the phase you need -->
67                                                 <phase>validate</phase>
68                                                 <configuration>
69                                                         <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
70                                                         <resources>
71                                                                 <resource>
72                                                                         <directory>src/main/docker</directory>
73                                                                         <includes>
74                                                                                 <include>Dockerfile</include>
75                                                                         </includes>
76                                                                         <filtering>true</filtering>
77                                                                 </resource>
78                                                         </resources>
79                                                 </configuration>
80                                         </execution>
81
82                                         <execution>
83                                                 <id>copy-scripts</id>
84                                                 <goals>
85                                                         <goal>copy-resources</goal>
86                                                 </goals><!-- here the phase you need -->
87                                                 <phase>validate</phase>
88                                                 <configuration>
89                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/bin</outputDirectory>
90                                                         <resources>
91                                                                 <resource>
92                                                                         <directory>src/main/scripts</directory>
93                                                                         <includes>
94                                                                                 <include>*.sh</include>
95                                                                         </includes>
96                                                                         <filtering>false</filtering>
97                                                                 </resource>
98                                                         </resources>
99                                                 </configuration>
100                                         </execution>
101                                         
102                                         <execution>
103                                                 <id>copy-data</id>
104                                                 <goals>
105                                                         <goal>copy-resources</goal>
106                                                 </goals>
107                                                 <phase>validate</phase>
108                                                 <configuration>
109                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data</outputDirectory>
110                                                         <resources>
111                                                                 <resource>
112                                                                         <directory>src/main/resources</directory>
113                                                                         <includes>
114                                                                                 <include>*.dump</include>
115                                                                                 <include>*.sh</include>
116                                                                                 <include>*.cfg</include>
117                                                                         </includes>
118                                                                         <filtering>false</filtering>
119                                                                 </resource>
120                                                         </resources>
121                                                 </configuration>
122                                         </execution>
123                                         
124                                         <execution>
125                                                 <id>copy-keystores</id>
126                                                 <goals>
127                                                         <goal>copy-resources</goal>
128                                                 </goals>
129                                                 <phase>validate</phase>
130                                                 <configuration>
131                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data/stores</outputDirectory>
132                                                         <resources>
133                                                                 <resource>
134                                                                         <directory>../src/main/stores</directory>
135                                                                         <includes>
136                                                                                 <include>*.jks</include>
137                                                                                 <include>*.p12</include>
138                                                                         </includes>
139                                                                         <filtering>false</filtering>
140                                                                 </resource>
141                                                         </resources>
142                                                 </configuration>
143                                         </execution>
144                                         
145                                         <execution>
146                                                 <id>copy-properties</id>
147                                                 <goals>
148                                                         <goal>copy-resources</goal>
149                                                 </goals>
150                                                 <phase>validate</phase>
151                                                 <configuration>
152                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data/properties</outputDirectory>
153                                                         <resources>
154                                                                 <resource>
155                                                                         <directory>../src/main/properties</directory>
156                                                                         <includes>
157                                                                                 <include>*.properties</include>
158                                                                         </includes>
159                                                                         <filtering>false</filtering>
160                                                                 </resource>
161                                                         </resources>
162                                                 </configuration>
163                                         </execution>
164                                 </executions>
165                         </plugin>
166                         <plugin>
167                                 <artifactId>exec-maven-plugin</artifactId>
168                                 <groupId>org.codehaus.mojo</groupId>
169                                 <version>1.5.0</version>
170                                 <executions>
171                                         <execution>
172                                                 <id>Get features</id>
173                                                 <phase>generate-sources</phase>
174                                                 <goals>
175                                                         <goal>exec</goal>
176                                                 </goals>
177                                                 <configuration>
178                                                         <executable>bash</executable>
179                                                         <environmentVariables>
180                                                                 <APPC_VERSION>${appc.version}</APPC_VERSION>
181                                                                 <APPC_OAM_VERSION>${project.version}</APPC_OAM_VERSION>
182                                                                 <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION>
183                                                         </environmentVariables>
184                                                         <arguments>
185                                                                 <argument>${basedir}/src/main/scripts/installZips.sh</argument>
186                                                                 <argument>${basedir}/target/docker-stage/opt/onap/appc</argument>
187                                                         </arguments>
188                                                 </configuration>
189                                         </execution>
190
191                                         <execution>
192                                                 <id>change shell permissions</id>
193                                                 <phase>process-sources</phase>
194                                                 <goals>
195                                                         <goal>exec</goal>
196                                                 </goals>
197                                                 <configuration>
198                                                         <executable>find</executable>
199                                                         <arguments>
200                                                                 <argument>${basedir}/target/docker-stage/opt/onap/appc</argument>
201                                                                 <argument>-name</argument>
202                                                                 <argument>*.sh</argument>
203                                                                 <argument>-exec</argument>
204                                                                 <argument>chmod</argument>
205                                                                 <argument>+x</argument>
206                                                                 <argument>{}</argument>
207                                                                 <argument>;</argument>
208                                                         </arguments>
209                                                 </configuration>
210                                         </execution>
211                                 </executions>
212                         </plugin>
213                 </plugins>
214         </build>
215
216         <profiles>
217                 <profile>
218                         <id>docker</id>
219                         <build>
220                                 <plugins>
221                                         <plugin>
222                                                 <groupId>org.codehaus.groovy.maven</groupId>
223                                                 <artifactId>gmaven-plugin</artifactId>
224                                                 <executions>
225                                                         <execution>
226                                                                 <phase>validate</phase>
227                                                                 <goals>
228                                                                         <goal>execute</goal>
229                                                                 </goals>
230                                                                 <configuration>
231                                                                         <properties>
232                                                                                 <ver>${project.version}</ver>
233                                                                                 <timestamp>${maven.build.timestamp}</timestamp>
234                                                                         </properties>
235                                                                         <source>
236                                                                                 println project.properties['ver'];
237                                                                                 def versionArray;
238                                                                                 if ( project.properties['ver'] != null ) {
239                                                                                 versionArray = project.properties['ver'].split('\\.');
240                                                                                 }
241                                                                                 if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
242                                                                                 project.properties['dockertag1']=project.properties['ver'] + "-latest";
243                                                                                 project.properties['dockertag2']="latest";
244                                                                                 project.properties['appc.version']=project.properties['appc.snapshot.version'];
245                                                                                 } else {
246                                                                                 project.properties['dockertag1']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
247                                                                                 project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
248                                                                                 project.properties['appc.version']=project.properties['appc.release.version'];
249                                                                                 }
250                                                                                 println 'docker tag 1: ' + project.properties['dockertag1'];
251                                                                                 println 'docker tag 2: ' + project.properties['dockertag2'];
252                                                                         </source>
253                                                                 </configuration>
254                                                         </execution>
255                                                 </executions>
256                                         </plugin>
257                                         <plugin>
258                                                 <groupId>io.fabric8</groupId>
259                                                 <artifactId>docker-maven-plugin</artifactId>
260                                                 <version>0.16.5</version>
261                                                 <inherited>false</inherited>
262                                                 <configuration>
263                                                         <images>
264                                                                 <image>
265                                                                         <name>${image.name}</name>
266                                                                         <build>
267                                                                                 <cleanup>try</cleanup>
268                                                                                 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
269                                                                                 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
270                                                                                 <tags>
271                                                                                         <tag>${dockertag1}</tag>
272                                                                                         <tag>${dockertag2}</tag>
273                                                                                 </tags>
274                                                                         </build>
275                                                                 </image>
276                                                         </images>
277                                                 </configuration>
278                                                 <executions>
279                                                         <execution>
280                                                                 <id>generate-images</id>
281                                                                 <phase>package</phase>
282                                                                 <goals>
283                                                                         <goal>build</goal>
284                                                                 </goals>
285                                                         </execution>
286
287                                                         <execution>
288                                                                 <id>push-images</id>
289                                                                 <phase>deploy</phase>
290                                                                 <goals>
291                                                                         <goal>build</goal>
292                                                                         <goal>push</goal>
293                                                                 </goals>
294                                                         </execution>
295                                                 </executions>
296                                         </plugin>
297
298                                         <!-- This is to add any extra scripts, sql dump files, properties files 
299                                                 APPC may need even after inheriting from the sdnc base image -->
300                                         <plugin>
301                                                 <artifactId>maven-resources-plugin</artifactId>
302                                                 <version>2.6</version>
303                                                 <executions>
304                                                         <execution>
305                                                                 <id>copy-dockerfile</id>
306                                                                 <goals>
307                                                                         <goal>copy-resources</goal>
308                                                                 </goals><!-- here the phase you need -->
309                                                                 <phase>validate</phase>
310                                                                 <configuration>
311                                                                         <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
312                                                                         <resources>
313                                                                                 <resource>
314                                                                                         <directory>src/main/docker</directory>
315                                                                                         <includes>
316                                                                                                 <include>Dockerfile</include>
317                                                                                         </includes>
318                                                                                         <filtering>true</filtering>
319                                                                                 </resource>
320                                                                         </resources>
321                                                                 </configuration>
322                                                         </execution>
323
324                                                         <execution>
325                                                                 <id>copy-scripts</id>
326                                                                 <goals>
327                                                                         <goal>copy-resources</goal>
328                                                                 </goals><!-- here the phase you need -->
329                                                                 <phase>validate</phase>
330                                                                 <configuration>
331                                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/bin</outputDirectory>
332                                                                         <resources>
333                                                                                 <resource>
334                                                                                         <directory>src/main/scripts</directory>
335                                                                                         <includes>
336                                                                                                 <include>*.sh</include>
337                                                                                         </includes>
338                                                                                         <filtering>false</filtering>
339                                                                                 </resource>
340                                                                         </resources>
341                                                                 </configuration>
342                                                         </execution>
343
344                                                         <execution>
345                                                                 <id>copy-data</id>
346                                                                 <goals>
347                                                                         <goal>copy-resources</goal>
348                                                                 </goals>
349                                                                 <phase>validate</phase>
350                                                                 <configuration>
351                                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data</outputDirectory>
352                                                                         <resources>
353                                                                                 <resource>
354                                                                                         <directory>src/main/resources</directory>
355                                                                                         <includes>
356                                                                                                 <include>*.dump</include>
357                                                                                                 <include>*.sh</include>
358                                                                                                 <include>*.cfg</include>                
359                                                                                         </includes>
360                                                                                         <filtering>false</filtering>
361                                                                                 </resource>
362                                                                         </resources>
363                                                                 </configuration>
364                                                         </execution>
365                                                         
366                                                         <execution>
367                                                                 <id>copy-keystores</id>
368                                                                 <goals>
369                                                                         <goal>copy-resources</goal>
370                                                                 </goals>
371                                                                 <phase>validate</phase>
372                                                                 <configuration>
373                                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data/stores</outputDirectory>
374                                                                         <resources>
375                                                                                 <resource>
376                                                                                         <directory>../src/main/stores</directory>
377                                                                                         <includes>
378                                                                                                 <include>*.jks</include>
379                                                                                                 <include>*.p12</include>
380                                                                                         </includes>
381                                                                                         <filtering>false</filtering>
382                                                                                 </resource>
383                                                                         </resources>
384                                                                 </configuration>
385                                                         </execution>
386
387                                                         <execution>
388                                                                 <id>copy-properties</id>
389                                                                 <goals>
390                                                                         <goal>copy-resources</goal>
391                                                                 </goals>
392                                                                 <phase>validate</phase>
393                                                                 <configuration>
394                                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data/properties</outputDirectory>
395                                                                         <resources>
396                                                                                 <resource>
397                                                                                         <directory>../src/main/properties</directory>
398                                                                                         <includes>
399                                                                                                 <include>*.properties</include>
400                                                                                         </includes>
401                                                                                         <filtering>false</filtering>
402                                                                                 </resource>
403                                                                         </resources>
404                                                                 </configuration>
405                                                         </execution>
406                                                 </executions>
407                                         </plugin>
408                                         <plugin>
409                                                 <artifactId>exec-maven-plugin</artifactId>
410                                                 <groupId>org.codehaus.mojo</groupId>
411                                                 <version>1.5.0</version>
412                                                 <executions>
413                                                         <execution>
414                                                                 <id>Get features</id>
415                                                                 <phase>generate-sources</phase>
416                                                                 <goals>
417                                                                         <goal>exec</goal>
418                                                                 </goals>
419                                                                 <configuration>
420                                                                         <executable>bash</executable>
421                                                                         <environmentVariables>
422                                                                                 <APPC_VERSION>${appc.version}</APPC_VERSION>
423                                                                                 <APPC_OAM_VERSION>${project.version}</APPC_OAM_VERSION>
424                                                                                 <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION>
425                                                                         </environmentVariables>
426                                                                         <arguments>
427                                                                                 <argument>${basedir}/src/main/scripts/installZips.sh</argument>
428                                                                                 <argument>${basedir}/target/docker-stage/opt/onap/appc</argument>
429                                                                                 <argument>${basedir}/target/docker-stage</argument>
430                                                                         </arguments>
431                                                                 </configuration>
432                                                         </execution>
433
434                                                         <execution>
435                                                                 <id>change shell permissions</id>
436                                                                 <phase>process-sources</phase>
437                                                                 <goals>
438                                                                         <goal>exec</goal>
439                                                                 </goals>
440                                                                 <configuration>
441                                                                         <executable>find</executable>
442                                                                         <arguments>
443                                                                                 <argument>${basedir}/target/docker-stage/opt/onap/appc</argument>
444                                                                                 <argument>-name</argument>
445                                                                                 <argument>*.sh</argument>
446                                                                                 <argument>-exec</argument>
447                                                                                 <argument>chmod</argument>
448                                                                                 <argument>+x</argument>
449                                                                                 <argument>{}</argument>
450                                                                                 <argument>;</argument>
451                                                                         </arguments>
452                                                                 </configuration>
453                                                         </execution>
454                                                 </executions>
455                                         </plugin>
456                                 </plugins>
457                         </build>
458
459                 </profile>
460         </profiles>
461         
462         <organization>
463                 <name>ONAP</name>
464         </organization>
465         
466 </project>