8b8dd9ff0948a07dfc7339de1e52c82fb7449a76
[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.6.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.6.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.4.4</appc.release.version>
44                 <appc.snapshot.version>1.6.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'Z'</maven.build.timestamp.format>
49                 <!--Determines the version of the cdt-proxy-service to download and install-->
50                 <appc.cdt.version>1.5.0-SNAPSHOT</appc.cdt.version>
51                 <docker.plugin.version>0.28.0</docker.plugin.version>
52         </properties>
53
54
55         <build>
56                 <plugins>
57                         
58                         <!-- This is to add any extra scripts, sql dump files, properties files APPC may need even after inheriting from the sdnc base image -->
59                         <plugin>
60                                 <artifactId>maven-resources-plugin</artifactId>
61                                 <version>2.6</version>
62                                 <executions>
63                                         <execution>
64                                                 <id>copy-dockerfile</id>
65                                                 <goals>
66                                                         <goal>copy-resources</goal>
67                                                 </goals><!-- here the phase you need -->
68                                                 <phase>validate</phase>
69                                                 <configuration>
70                                                         <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
71                                                         <resources>
72                                                                 <resource>
73                                                                         <directory>src/main/docker</directory>
74                                                                         <includes>
75                                                                                 <include>Dockerfile</include>
76                                                                         </includes>
77                                                                         <filtering>true</filtering>
78                                                                 </resource>
79                                                         </resources>
80                                                 </configuration>
81                                         </execution>
82
83                                         <execution>
84                                                 <id>copy-scripts</id>
85                                                 <goals>
86                                                         <goal>copy-resources</goal>
87                                                 </goals><!-- here the phase you need -->
88                                                 <phase>validate</phase>
89                                                 <configuration>
90                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/bin</outputDirectory>
91                                                         <resources>
92                                                                 <resource>
93                                                                         <directory>src/main/scripts</directory>
94                                                                         <includes>
95                                                                                 <include>*.sh</include>
96                                                                         </includes>
97                                                                         <filtering>false</filtering>
98                                                                 </resource>
99                                                         </resources>
100                                                 </configuration>
101                                         </execution>
102                                         
103                                         <execution>
104                                                 <id>copy-data</id>
105                                                 <goals>
106                                                         <goal>copy-resources</goal>
107                                                 </goals>
108                                                 <phase>validate</phase>
109                                                 <configuration>
110                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data</outputDirectory>
111                                                         <resources>
112                                                                 <resource>
113                                                                         <directory>src/main/resources</directory>
114                                                                         <includes>
115                                                                                 <include>*.dump</include>
116                                                                                 <include>*.sh</include>
117                                                                                 <include>*.cfg</include>
118                                                                                 <include>*.xml</include>
119                                                                         </includes>
120                                                                         <filtering>false</filtering>
121                                                                 </resource>
122                                                         </resources>
123                                                 </configuration>
124                                         </execution>
125                                         
126                                         <execution>
127                                                 <id>copy-keystores</id>
128                                                 <goals>
129                                                         <goal>copy-resources</goal>
130                                                 </goals>
131                                                 <phase>validate</phase>
132                                                 <configuration>
133                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data/stores</outputDirectory>
134                                                         <resources>
135                                                                 <resource>
136                                                                         <directory>../src/main/stores</directory>
137                                                                         <includes>
138                                                                                 <include>*.jks</include>
139                                                                                 <include>*.p12</include>
140                                                                                 <include>*keyfile</include>
141                                                                         </includes>
142                                                                         <filtering>false</filtering>
143                                                                 </resource>
144                                                         </resources>
145                                                 </configuration>
146                                         </execution>
147                                         
148                                         <execution>
149                                                 <id>copy-properties</id>
150                                                 <goals>
151                                                         <goal>copy-resources</goal>
152                                                 </goals>
153                                                 <phase>validate</phase>
154                                                 <configuration>
155                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data/properties</outputDirectory>
156                                                         <resources>
157                                                                 <resource>
158                                                                         <directory>../src/main/properties</directory>
159                                                                         <includes>
160                                                                                 <include>*.properties</include>
161                                                                                 <include>*.csv</include>
162                                                                         </includes>
163                                                                         <filtering>false</filtering>
164                                                                 </resource>
165                                                         </resources>
166                                                 </configuration>
167                                         </execution>
168                                 </executions>
169                         </plugin>
170                         <plugin>
171                                 <artifactId>exec-maven-plugin</artifactId>
172                                 <groupId>org.codehaus.mojo</groupId>
173                                 <version>1.5.0</version>
174                                 <executions>
175                                         <execution>
176                                                 <id>Get features</id>
177                                                 <phase>generate-sources</phase>
178                                                 <goals>
179                                                         <goal>exec</goal>
180                                                 </goals>
181                                                 <configuration>
182                                                         <executable>bash</executable>
183                                                         <environmentVariables>
184                                                                 <APPC_VERSION>${appc.version}</APPC_VERSION>
185                                                                 <APPC_CDT_VERSION>${appc.cdt.version}</APPC_CDT_VERSION>
186                                                                 <APPC_OAM_VERSION>${project.version}</APPC_OAM_VERSION>
187                                                                 <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION>
188                                                         </environmentVariables>
189                                                         <arguments>
190                                                                 <argument>${basedir}/src/main/scripts/installZips.sh</argument>
191                                                                 <argument>${basedir}/target/docker-stage/opt/onap/appc</argument>
192                                                         </arguments>
193                                                 </configuration>
194                                         </execution>
195
196                                         <execution>
197                                                 <id>change shell permissions</id>
198                                                 <phase>process-sources</phase>
199                                                 <goals>
200                                                         <goal>exec</goal>
201                                                 </goals>
202                                                 <configuration>
203                                                         <executable>find</executable>
204                                                         <arguments>
205                                                                 <argument>${basedir}/target/docker-stage/opt/onap/appc</argument>
206                                                                 <argument>-name</argument>
207                                                                 <argument>*.sh</argument>
208                                                                 <argument>-exec</argument>
209                                                                 <argument>chmod</argument>
210                                                                 <argument>+x</argument>
211                                                                 <argument>{}</argument>
212                                                                 <argument>;</argument>
213                                                         </arguments>
214                                                 </configuration>
215                                         </execution>
216                                 </executions>
217                         </plugin>
218                 </plugins>
219         </build>
220
221         <profiles>
222                 <profile>
223                         <id>docker</id>
224                         <build>
225                                 <plugins>
226                                         <plugin>
227                                                 <groupId>org.codehaus.groovy.maven</groupId>
228                                                 <artifactId>gmaven-plugin</artifactId>
229                                                 <executions>
230                                                         <execution>
231                                                                 <phase>validate</phase>
232                                                                 <goals>
233                                                                         <goal>execute</goal>
234                                                                 </goals>
235                                                                 <configuration>
236                                                                         <properties>
237                                                                                 <ver>${project.version}</ver>
238                                                                                 <timestamp>${maven.build.timestamp}</timestamp>
239                                                                         </properties>
240                                                                         <source>
241                                                                                 println project.properties['ver'];
242                                                                                 def versionArray;
243                                                                                 if ( project.properties['ver'] != null ) {
244                                                                                 versionArray = project.properties['ver'].split('\\.');
245                                                                                 }
246                                                                                 if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
247                                                                                 project.properties['dockertag1']=project.properties['ver'] + "-latest";
248                                                                                 project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp'];
249                                                                                 project.properties['appc.version']=project.properties['appc.snapshot.version'];
250                                                                                 } else {
251                                                                                 project.properties['dockertag1']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
252                                                                                 project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
253                                                                                 project.properties['appc.version']=project.properties['appc.release.version'];
254                                                                                 }
255                                                                                 println 'docker tag 1: ' + project.properties['dockertag1'];
256                                                                                 println 'docker tag 2: ' + project.properties['dockertag2'];
257                                                                         </source>
258                                                                 </configuration>
259                                                         </execution>
260                                                 </executions>
261                                         </plugin>
262                                         <plugin>
263                                                 <groupId>io.fabric8</groupId>
264                                                 <artifactId>docker-maven-plugin</artifactId>
265                                                 <version>${docker.plugin.version}</version>
266                                                 <inherited>false</inherited>
267                                                 <configuration>
268                                                         <images>
269                                                                 <image>
270                                                                         <name>${image.name}</name>
271                                                                         <build>
272                                                                                 <cleanup>try</cleanup>
273                                                                                 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
274                                                                                 <dockerFile>Dockerfile</dockerFile>
275                                                                                 <tags>
276                                                                                         <tag>${dockertag1}</tag>
277                                                                                         <tag>${dockertag2}</tag>
278                                                                                 </tags>
279                                                                         </build>
280                                                                 </image>
281                                                         </images>
282                                                 </configuration>
283                                                 <executions>
284                                                         <execution>
285                                                                 <id>generate-images</id>
286                                                                 <phase>package</phase>
287                                                                 <goals>
288                                                                         <goal>build</goal>
289                                                                 </goals>
290                                                         </execution>
291
292                                                         <execution>
293                                                                 <id>push-images</id>
294                                                                 <phase>deploy</phase>
295                                                                 <goals>
296                                                                         <goal>build</goal>
297                                                                         <goal>push</goal>
298                                                                 </goals>
299                                                         </execution>
300                                                 </executions>
301                                         </plugin>
302
303                                         <!-- This is to add any extra scripts, sql dump files, properties files 
304                                                 APPC may need even after inheriting from the sdnc base image -->
305                                         <plugin>
306                                                 <artifactId>maven-resources-plugin</artifactId>
307                                                 <version>2.6</version>
308                                                 <executions>
309                                                         <execution>
310                                                                 <id>copy-dockerfile</id>
311                                                                 <goals>
312                                                                         <goal>copy-resources</goal>
313                                                                 </goals><!-- here the phase you need -->
314                                                                 <phase>validate</phase>
315                                                                 <configuration>
316                                                                         <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
317                                                                         <resources>
318                                                                                 <resource>
319                                                                                         <directory>src/main/docker</directory>
320                                                                                         <includes>
321                                                                                                 <include>Dockerfile</include>
322                                                                                         </includes>
323                                                                                         <filtering>true</filtering>
324                                                                                 </resource>
325                                                                         </resources>
326                                                                 </configuration>
327                                                         </execution>
328
329                                                         <execution>
330                                                                 <id>copy-scripts</id>
331                                                                 <goals>
332                                                                         <goal>copy-resources</goal>
333                                                                 </goals><!-- here the phase you need -->
334                                                                 <phase>validate</phase>
335                                                                 <configuration>
336                                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/bin</outputDirectory>
337                                                                         <resources>
338                                                                                 <resource>
339                                                                                         <directory>src/main/scripts</directory>
340                                                                                         <includes>
341                                                                                                 <include>*.sh</include>
342                                                                                         </includes>
343                                                                                         <filtering>false</filtering>
344                                                                                 </resource>
345                                                                         </resources>
346                                                                 </configuration>
347                                                         </execution>
348
349                                                         <execution>
350                                                                 <id>copy-data</id>
351                                                                 <goals>
352                                                                         <goal>copy-resources</goal>
353                                                                 </goals>
354                                                                 <phase>validate</phase>
355                                                                 <configuration>
356                                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data</outputDirectory>
357                                                                         <resources>
358                                                                                 <resource>
359                                                                                         <directory>src/main/resources</directory>
360                                                                                         <includes>
361                                                                                                 <include>*.dump</include>
362                                                                                                 <include>*.sh</include>
363                                                                                                 <include>*.cfg</include>
364                                                                                                 <include>*.xml</include>
365                                                                                         </includes>
366                                                                                         <filtering>false</filtering>
367                                                                                 </resource>
368                                                                         </resources>
369                                                                 </configuration>
370                                                         </execution>
371                                                         
372                                                         <execution>
373                                                                 <id>copy-keystores</id>
374                                                                 <goals>
375                                                                         <goal>copy-resources</goal>
376                                                                 </goals>
377                                                                 <phase>validate</phase>
378                                                                 <configuration>
379                                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data/stores</outputDirectory>
380                                                                         <resources>
381                                                                                 <resource>
382                                                                                         <directory>../src/main/stores</directory>
383                                                                                         <includes>
384                                                                                                 <include>*.jks</include>
385                                                                                                 <include>*.p12</include>
386                                                                                                 <include>*.keyfile</include>
387                                                                                         </includes>
388                                                                                         <filtering>false</filtering>
389                                                                                 </resource>
390                                                                         </resources>
391                                                                 </configuration>
392                                                         </execution>
393
394                                                         <execution>
395                                                                 <id>copy-properties</id>
396                                                                 <goals>
397                                                                         <goal>copy-resources</goal>
398                                                                 </goals>
399                                                                 <phase>validate</phase>
400                                                                 <configuration>
401                                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/data/properties</outputDirectory>
402                                                                         <resources>
403                                                                                 <resource>
404                                                                                         <directory>../src/main/properties</directory>
405                                                                                         <includes>
406                                                                                                 <include>*.properties</include>
407                                                                                                 <include>*.csv</include>
408                                                                                         </includes>
409                                                                                         <filtering>false</filtering>
410                                                                                 </resource>
411                                                                         </resources>
412                                                                 </configuration>
413                                                         </execution>
414                                                 </executions>
415                                         </plugin>
416                                         <plugin>
417                                                 <artifactId>exec-maven-plugin</artifactId>
418                                                 <groupId>org.codehaus.mojo</groupId>
419                                                 <version>1.5.0</version>
420                                                 <executions>
421                                                         <execution>
422                                                                 <id>Get features</id>
423                                                                 <phase>generate-sources</phase>
424                                                                 <goals>
425                                                                         <goal>exec</goal>
426                                                                 </goals>
427                                                                 <configuration>
428                                                                         <executable>bash</executable>
429                                                                         <environmentVariables>
430                                                                                 <APPC_VERSION>${appc.version}</APPC_VERSION>
431                                                                                 <APPC_OAM_VERSION>${project.version}</APPC_OAM_VERSION>
432                                                                                 <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION>
433                                                                         </environmentVariables>
434                                                                         <arguments>
435                                                                                 <argument>${basedir}/src/main/scripts/installZips.sh</argument>
436                                                                                 <argument>${basedir}/target/docker-stage/opt/onap/appc</argument>
437                                                                                 <argument>${basedir}/target/docker-stage</argument>
438                                                                         </arguments>
439                                                                 </configuration>
440                                                         </execution>
441
442                                                         <execution>
443                                                                 <id>change shell permissions</id>
444                                                                 <phase>process-sources</phase>
445                                                                 <goals>
446                                                                         <goal>exec</goal>
447                                                                 </goals>
448                                                                 <configuration>
449                                                                         <executable>find</executable>
450                                                                         <arguments>
451                                                                                 <argument>${basedir}/target/docker-stage/opt/onap/appc</argument>
452                                                                                 <argument>-name</argument>
453                                                                                 <argument>*.sh</argument>
454                                                                                 <argument>-exec</argument>
455                                                                                 <argument>chmod</argument>
456                                                                                 <argument>+x</argument>
457                                                                                 <argument>{}</argument>
458                                                                                 <argument>;</argument>
459                                                                         </arguments>
460                                                                 </configuration>
461                                                         </execution>
462                                                 </executions>
463                                         </plugin>
464                                 </plugins>
465                         </build>
466
467                 </profile>
468         </profiles>
469         
470         <organization>
471                 <name>ONAP</name>
472         </organization>
473         
474 </project>