add AAF configuration files
[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 ============LICENSE_END============================================
22 -->
23 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
25
26         <parent>
27                 <groupId>org.onap.appc.deployment</groupId>
28                 <artifactId>installation</artifactId>
29                 <version>1.3.0-SNAPSHOT</version>
30         </parent>
31
32         <modelVersion>4.0.0</modelVersion>
33         <packaging>pom</packaging>
34         <groupId>org.onap.appc.deployment</groupId>
35         <artifactId>installation-appc</artifactId>
36         <version>1.3.0-SNAPSHOT</version>
37
38         <name>Installation - APPC Docker</name>
39         <description>Creates APPC Docker container on top of the SDNC Base Docker Image</description>
40
41         <properties>
42                 <image.name>onap/appc-image</image.name>
43                 <appc.release.version>1.3.0</appc.release.version>
44                 <appc.snapshot.version>1.3.0-SNAPSHOT</appc.snapshot.version>
45                 <!--This version will be over-ridden by jenkins 
46                     injecting the version.properties variable file during docker build-->
47                 <appc.docker.staging.version>1.0.0</appc.docker.staging.version>
48                 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
49         </properties>
50
51
52         <build>
53                 <plugins>
54                         
55                         <!-- This is to add any extra scripts, sql dump files, properties files APPC may need even after inheriting from the sdnc base image -->
56                         <plugin>
57                                 <artifactId>maven-resources-plugin</artifactId>
58                                 <version>2.6</version>
59                                 <executions>
60                                         <execution>
61                                                 <id>copy-dockerfile</id>
62                                                 <goals>
63                                                         <goal>copy-resources</goal>
64                                                 </goals><!-- here the phase you need -->
65                                                 <phase>validate</phase>
66                                                 <configuration>
67                                                         <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
68                                                         <resources>
69                                                                 <resource>
70                                                                         <directory>src/main/docker</directory>
71                                                                         <includes>
72                                                                                 <include>Dockerfile</include>
73                                                                         </includes>
74                                                                         <filtering>true</filtering>
75                                                                 </resource>
76                                                         </resources>
77                                                 </configuration>
78                                         </execution>
79
80                                         <execution>
81                                                 <id>copy-scripts</id>
82                                                 <goals>
83                                                         <goal>copy-resources</goal>
84                                                 </goals><!-- here the phase you need -->
85                                                 <phase>validate</phase>
86                                                 <configuration>
87                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/bin</outputDirectory>
88                                                         <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>
98                                         </execution>
99                                         
100                                         <execution>
101                                                 <id>copy-data</id>
102                                                 <goals>
103                                                         <goal>copy-resources</goal>
104                                                 </goals>
105                                                 <phase>validate</phase>
106                                                 <configuration>
107                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data</outputDirectory>
108                                                         <resources>
109                                                                 <resource>
110                                                                         <directory>src/main/resources</directory>
111                                                                         <includes>
112                                                                                 <include>*.dump</include>
113                                                                                 <include>*.sh</include>
114                                                                                 <include>*.cfg</include>
115                                                                                 <include>*.ini</include>
116                                                                         </includes>
117                                                                         <filtering>false</filtering>
118                                                                 </resource>
119                                                         </resources>
120                                                 </configuration>
121                                         </execution>
122                                         
123                                         <execution>
124                                                 <id>copy-keystores</id>
125                                                 <goals>
126                                                         <goal>copy-resources</goal>
127                                                 </goals>
128                                                 <phase>validate</phase>
129                                                 <configuration>
130                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data/stores</outputDirectory>
131                                                         <resources>
132                                                                 <resource>
133                                                                         <directory>../src/main/stores</directory>
134                                                                         <includes>
135                                                                                 <include>*.jks</include>
136                                                                                 <include>*.p12</include>
137                                                                         </includes>
138                                                                         <filtering>false</filtering>
139                                                                 </resource>
140                                                         </resources>
141                                                 </configuration>
142                                         </execution>
143                                         
144                                         <execution>
145                                                 <id>copy-properties</id>
146                                                 <goals>
147                                                         <goal>copy-resources</goal>
148                                                 </goals>
149                                                 <phase>validate</phase>
150                                                 <configuration>
151                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data/properties</outputDirectory>
152                                                         <resources>
153                                                                 <resource>
154                                                                         <directory>../src/main/properties</directory>
155                                                                         <includes>
156                                                                                 <include>*.properties</include>
157                                                                         </includes>
158                                                                         <filtering>false</filtering>
159                                                                 </resource>
160                                                         </resources>
161                                                 </configuration>
162                                         </execution>
163                                 </executions>
164                         </plugin>
165                         <plugin>
166                                 <artifactId>exec-maven-plugin</artifactId>
167                                 <groupId>org.codehaus.mojo</groupId>
168                                 <version>1.5.0</version>
169                                 <executions>
170                                         <execution>
171                                                 <id>Get features</id>
172                                                 <phase>generate-sources</phase>
173                                                 <goals>
174                                                         <goal>exec</goal>
175                                                 </goals>
176                                                 <configuration>
177                                                         <executable>bash</executable>
178                                                         <environmentVariables>
179                                                                 <APPC_VERSION>${appc.version}</APPC_VERSION>
180                                                                 <APPC_OAM_VERSION>${project.version}</APPC_OAM_VERSION>
181                                                                 <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION>
182                                                         </environmentVariables>
183                                                         <arguments>
184                                                                 <argument>${basedir}/src/main/scripts/installZips.sh</argument>
185                                                                 <argument>${basedir}/target/docker-stage/opt/onap/appc</argument>
186                                                         </arguments>
187                                                 </configuration>
188                                         </execution>
189
190                                         <execution>
191                                                 <id>change shell permissions</id>
192                                                 <phase>process-sources</phase>
193                                                 <goals>
194                                                         <goal>exec</goal>
195                                                 </goals>
196                                                 <configuration>
197                                                         <executable>find</executable>
198                                                         <arguments>
199                                                                 <argument>${basedir}/target/docker-stage/opt/onap/appc</argument>
200                                                                 <argument>-name</argument>
201                                                                 <argument>*.sh</argument>
202                                                                 <argument>-exec</argument>
203                                                                 <argument>chmod</argument>
204                                                                 <argument>+x</argument>
205                                                                 <argument>{}</argument>
206                                                                 <argument>;</argument>
207                                                         </arguments>
208                                                 </configuration>
209                                         </execution>
210                                 </executions>
211                         </plugin>
212                 </plugins>
213         </build>
214
215         <profiles>
216                 <profile>
217                         <id>docker</id>
218                         <build>
219                                 <plugins>
220                                         <plugin>
221                                                 <groupId>org.codehaus.groovy.maven</groupId>
222                                                 <artifactId>gmaven-plugin</artifactId>
223                                                 <executions>
224                                                         <execution>
225                                                                 <phase>validate</phase>
226                                                                 <goals>
227                                                                         <goal>execute</goal>
228                                                                 </goals>
229                                                                 <configuration>
230                                                                         <properties>
231                                                                                 <ver>${project.version}</ver>
232                                                                                 <timestamp>${maven.build.timestamp}</timestamp>
233                                                                         </properties>
234                                                                         <source>
235                                                                                 println project.properties['ver'];
236                                                                                 def versionArray;
237                                                                                 if ( project.properties['ver'] != null ) {
238                                                                                 versionArray = project.properties['ver'].split('\\.');
239                                                                                 }
240                                                                                 if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
241                                                                                 project.properties['dockertag1']=project.properties['ver'] + "-latest";
242                                                                                 project.properties['dockertag2']="latest";
243                                                                                 project.properties['appc.version']=project.properties['appc.snapshot.version'];
244                                                                                 } else {
245                                                                                 project.properties['dockertag1']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
246                                                                                 project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
247                                                                                 project.properties['appc.version']=project.properties['appc.release.version'];
248                                                                                 }
249                                                                                 println 'docker tag 1: ' + project.properties['dockertag1'];
250                                                                                 println 'docker tag 2: ' + project.properties['dockertag2'];
251                                                                         </source>
252                                                                 </configuration>
253                                                         </execution>
254                                                 </executions>
255                                         </plugin>
256                                         <plugin>
257                                                 <groupId>io.fabric8</groupId>
258                                                 <artifactId>docker-maven-plugin</artifactId>
259                                                 <version>0.16.5</version>
260                                                 <inherited>false</inherited>
261                                                 <configuration>
262                                                         <images>
263                                                                 <image>
264                                                                         <name>${image.name}</name>
265                                                                         <build>
266                                                                                 <cleanup>try</cleanup>
267                                                                                 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
268                                                                                 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
269                                                                                 <tags>
270                                                                                         <tag>${dockertag1}</tag>
271                                                                                         <tag>${dockertag2}</tag>
272                                                                                 </tags>
273                                                                         </build>
274                                                                 </image>
275                                                         </images>
276                                                 </configuration>
277                                                 <executions>
278                                                         <execution>
279                                                                 <id>generate-images</id>
280                                                                 <phase>package</phase>
281                                                                 <goals>
282                                                                         <goal>build</goal>
283                                                                 </goals>
284                                                         </execution>
285
286                                                         <execution>
287                                                                 <id>push-images</id>
288                                                                 <phase>deploy</phase>
289                                                                 <goals>
290                                                                         <goal>build</goal>
291                                                                         <goal>push</goal>
292                                                                 </goals>
293                                                         </execution>
294                                                 </executions>
295                                         </plugin>
296
297                                         <!-- This is to add any extra scripts, sql dump files, properties files 
298                                                 APPC may need even after inheriting from the sdnc base image -->
299                                         <plugin>
300                                                 <artifactId>maven-resources-plugin</artifactId>
301                                                 <version>2.6</version>
302                                                 <executions>
303                                                         <execution>
304                                                                 <id>copy-dockerfile</id>
305                                                                 <goals>
306                                                                         <goal>copy-resources</goal>
307                                                                 </goals><!-- here the phase you need -->
308                                                                 <phase>validate</phase>
309                                                                 <configuration>
310                                                                         <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
311                                                                         <resources>
312                                                                                 <resource>
313                                                                                         <directory>src/main/docker</directory>
314                                                                                         <includes>
315                                                                                                 <include>Dockerfile</include>
316                                                                                         </includes>
317                                                                                         <filtering>true</filtering>
318                                                                                 </resource>
319                                                                         </resources>
320                                                                 </configuration>
321                                                         </execution>
322
323                                                         <execution>
324                                                                 <id>copy-scripts</id>
325                                                                 <goals>
326                                                                         <goal>copy-resources</goal>
327                                                                 </goals><!-- here the phase you need -->
328                                                                 <phase>validate</phase>
329                                                                 <configuration>
330                                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/bin</outputDirectory>
331                                                                         <resources>
332                                                                                 <resource>
333                                                                                         <directory>src/main/scripts</directory>
334                                                                                         <includes>
335                                                                                                 <include>*.sh</include>
336                                                                                         </includes>
337                                                                                         <filtering>false</filtering>
338                                                                                 </resource>
339                                                                         </resources>
340                                                                 </configuration>
341                                                         </execution>
342
343                                                         <execution>
344                                                                 <id>copy-data</id>
345                                                                 <goals>
346                                                                         <goal>copy-resources</goal>
347                                                                 </goals>
348                                                                 <phase>validate</phase>
349                                                                 <configuration>
350                                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data</outputDirectory>
351                                                                         <resources>
352                                                                                 <resource>
353                                                                                         <directory>src/main/resources</directory>
354                                                                                         <includes>
355                                                                                                 <include>*.dump</include>
356                                                                                                 <include>*.sh</include>
357                                                                                                 <include>*.cfg</include>
358                                                                                                 <include>*.ini</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>