Little refactoring on Dockerfile and pom.xml
[ccsdk/distribution.git] / odlsli / odlsli-alpine / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3     <modelVersion>4.0.0</modelVersion>
4
5     <parent>
6         <groupId>org.onap.ccsdk.distribution</groupId>
7         <artifactId>distribution-odlsli</artifactId>
8         <version>1.2.0-SNAPSHOT</version>
9     </parent>
10
11     <artifactId>distribution-odlsli-alpine</artifactId>
12     <packaging>pom</packaging>
13
14     <name>ccsdk-distribution :: odlsli-alpine</name>
15     <description>Creates Alpine-based ODLSLI Docker container</description>
16     <organization>
17         <name>openECOMP</name>
18     </organization>
19
20     <properties>
21         <base.image.name>onap/ccsdk-odl-silicon-alpine-image</base.image.name>
22         <image.name>onap/ccsdk-odlsli-alpine-image</image.name>
23
24         <ccsdk.project.version>${project.version}</ccsdk.project.version>
25         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
26             <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
27
28         <docker.verbose>true</docker.verbose>
29
30         <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
31         <opendaylight.root>opt/opendaylight</opendaylight.root>
32
33         <ansible.gpg.key>93C4A3FD7BB9C367</ansible.gpg.key>
34         <!-- ODL Features Boot -->
35         <extra.odl.features>
36             odl-restconf-all,odl-mdsal-all,odl-mdsal-apidocs,odl-daexim-all,odl-restconf-nb-rfc8040
37         </extra.odl.features>
38         <!-- SLI Features Boot -->
39         <ccsdk.sli.features>
40             ccsdk-sli-core-all,ccsdk-sli-adaptors-all,ccsdk-sli-northbound-all,ccsdk-sli-plugins-all
41         </ccsdk.sli.features>
42         <!-- SLI Features Repositories -->
43         <ccsdk.sli.features.repo>
44             mvn:org.onap.ccsdk.sli.core/ccsdk-sli-core-all/${ccsdk.sli.version}/xml/features,\
45             mvn:org.onap.ccsdk.sli.adaptors/ccsdk-sli-adaptors-all/${ccsdk.sli.version}/xml/features,\
46             mvn:org.onap.ccsdk.sli.northbound/ccsdk-sli-northbound-all/${ccsdk.sli.version}/xml/features,\
47             mvn:org.onap.ccsdk.sli.plugins/ccsdk-sli-plugins-all/${ccsdk.sli.version}/xml/features
48         </ccsdk.sli.features.repo>
49         <docker.autoCreateCustomNetworks>true</docker.autoCreateCustomNetworks>
50     </properties>
51
52     <dependencies>
53         <dependency>
54             <groupId>${project.groupId}</groupId>
55             <artifactId>dependencies</artifactId>
56             <version>${project.version}</version>
57             <type>zip</type>
58             <classifier>repo</classifier>
59         </dependency>
60         <dependency>
61             <groupId>org.onap.ccsdk.sli.core</groupId>
62             <artifactId>dblib-installer</artifactId>
63             <version>${ccsdk.sli.version}</version>
64             <type>zip</type>
65             <classifier>repo</classifier>
66         </dependency>
67         <dependency>
68             <groupId>org.onap.ccsdk.sli.core</groupId>
69             <artifactId>filters-installer</artifactId>
70             <version>${ccsdk.sli.version}</version>
71             <type>zip</type>
72             <classifier>repo</classifier>
73         </dependency>
74         <dependency>
75             <groupId>org.onap.ccsdk.sli.core</groupId>
76             <artifactId>sli-installer</artifactId>
77             <version>${ccsdk.sli.version}</version>
78             <type>zip</type>
79             <classifier>repo</classifier>
80         </dependency>
81         <dependency>
82             <groupId>org.onap.ccsdk.sli.core</groupId>
83             <artifactId>sliapi-installer</artifactId>
84             <version>${ccsdk.sli.version}</version>
85             <type>zip</type>
86             <classifier>repo</classifier>
87         </dependency>
88         <dependency>
89             <groupId>org.onap.ccsdk.sli.core</groupId>
90             <artifactId>sliPluginUtils-installer</artifactId>
91             <version>${ccsdk.sli.version}</version>
92             <type>zip</type>
93             <classifier>repo</classifier>
94         </dependency>
95         <dependency>
96             <groupId>org.onap.ccsdk.sli.core</groupId>
97             <artifactId>utils-installer</artifactId>
98             <version>${ccsdk.sli.version}</version>
99             <type>zip</type>
100             <classifier>repo</classifier>
101         </dependency>
102         <dependency>
103             <groupId>org.onap.ccsdk.sli.core</groupId>
104             <artifactId>slicore-features-installer</artifactId>
105             <version>${ccsdk.sli.version}</version>
106             <type>zip</type>
107             <classifier>repo</classifier>
108         </dependency>
109         <dependency>
110             <groupId>org.onap.ccsdk.sli.adaptors</groupId>
111             <artifactId>aai-service-installer</artifactId>
112             <version>${ccsdk.sli.version}</version>
113             <type>zip</type>
114             <classifier>repo</classifier>
115         </dependency>
116         <dependency>
117             <groupId>org.onap.ccsdk.sli.adaptors</groupId>
118             <artifactId>ansible-adaptor-installer</artifactId>
119             <version>${ccsdk.sli.version}</version>
120             <type>zip</type>
121             <classifier>repo</classifier>
122         </dependency>
123         <dependency>
124             <groupId>org.onap.ccsdk.sli.adaptors</groupId>
125             <artifactId>base-http-installer</artifactId>
126             <version>${ccsdk.sli.version}</version>
127             <type>zip</type>
128             <classifier>repo</classifier>
129         </dependency>
130         <dependency>
131             <groupId>org.onap.ccsdk.sli.adaptors</groupId>
132             <artifactId>mdsal-resource-installer</artifactId>
133             <version>${ccsdk.sli.version}</version>
134             <type>zip</type>
135             <classifier>repo</classifier>
136         </dependency>
137         <dependency>
138             <groupId>org.onap.ccsdk.sli.adaptors.messagerouter</groupId>
139             <artifactId>publisher.installer</artifactId>
140             <version>${ccsdk.sli.version}</version>
141             <type>zip</type>
142             <classifier>repo</classifier>
143         </dependency>
144         <dependency>
145             <groupId>org.onap.ccsdk.sli.adaptors</groupId>
146             <artifactId>netbox-client-installer</artifactId>
147             <version>${ccsdk.sli.version}</version>
148             <type>zip</type>
149             <classifier>repo</classifier>
150         </dependency>
151         <dependency>
152             <groupId>org.onap.ccsdk.sli.adaptors</groupId>
153             <artifactId>resource-assignment-installer</artifactId>
154             <version>${ccsdk.sli.version}</version>
155             <type>zip</type>
156             <classifier>repo</classifier>
157         </dependency>
158         <dependency>
159             <groupId>org.onap.ccsdk.sli.adaptors</groupId>
160             <artifactId>saltstack-adaptor-installer</artifactId>
161             <version>${ccsdk.sli.version}</version>
162             <type>zip</type>
163             <classifier>repo</classifier>
164         </dependency>
165         <dependency>
166             <groupId>org.onap.ccsdk.sli.adaptors</groupId>
167             <artifactId>sql-resource-installer</artifactId>
168             <version>${ccsdk.sli.version}</version>
169             <type>zip</type>
170             <classifier>repo</classifier>
171         </dependency>
172         <dependency>
173             <groupId>org.onap.ccsdk.sli.adaptors</groupId>
174             <artifactId>sliadaptors-features-installer</artifactId>
175             <version>${ccsdk.sli.version}</version>
176             <type>zip</type>
177             <classifier>repo</classifier>
178         </dependency>
179         <dependency>
180             <groupId>org.onap.ccsdk.sli.northbound</groupId>
181             <artifactId>asdcApi-installer</artifactId>
182             <version>${ccsdk.sli.version}</version>
183             <type>zip</type>
184             <classifier>repo</classifier>
185         </dependency>
186         <dependency>
187             <groupId>org.onap.ccsdk.sli.northbound</groupId>
188             <artifactId>dataChange-installer</artifactId>
189             <version>${ccsdk.sli.version}</version>
190             <type>zip</type>
191             <classifier>repo</classifier>
192         </dependency>
193         <dependency>
194             <groupId>org.onap.ccsdk.sli.northbound</groupId>
195             <artifactId>lcm-installer</artifactId>
196             <version>${ccsdk.sli.version}</version>
197             <type>zip</type>
198             <classifier>repo</classifier>
199         </dependency>
200         <dependency>
201             <groupId>org.onap.ccsdk.sli.northbound</groupId>
202             <artifactId>slinorthbound-features-installer</artifactId>
203             <version>${ccsdk.sli.version}</version>
204             <type>zip</type>
205             <classifier>repo</classifier>
206         </dependency>
207         <dependency>
208             <groupId>org.onap.ccsdk.sli.plugins</groupId>
209             <artifactId>properties-node-installer</artifactId>
210             <version>${ccsdk.sli.version}</version>
211             <type>zip</type>
212             <classifier>repo</classifier>
213         </dependency>
214         <dependency>
215             <groupId>org.onap.ccsdk.sli.plugins</groupId>
216             <artifactId>restapi-call-node-installer</artifactId>
217             <version>${ccsdk.sli.version}</version>
218             <type>zip</type>
219             <classifier>repo</classifier>
220         </dependency>
221         <dependency>
222             <groupId>org.onap.ccsdk.sli.plugins</groupId>
223             <artifactId>template-node-installer</artifactId>
224             <version>${ccsdk.sli.version}</version>
225             <type>zip</type>
226             <classifier>repo</classifier>
227         </dependency>
228         <dependency>
229             <groupId>org.onap.ccsdk.sli.plugins</groupId>
230             <artifactId>restconf-client-installer</artifactId>
231             <version>${ccsdk.sli.version}</version>
232             <type>zip</type>
233             <classifier>repo</classifier>
234         </dependency>
235         <dependency>
236             <groupId>org.onap.ccsdk.sli.plugins</groupId>
237             <artifactId>sshapi-call-node-installer</artifactId>
238             <version>${ccsdk.sli.version}</version>
239             <type>zip</type>
240             <classifier>repo</classifier>
241         </dependency>
242         <dependency>
243             <groupId>org.onap.ccsdk.sli.plugins</groupId>
244             <artifactId>sliplugins-features-installer</artifactId>
245             <version>${ccsdk.sli.version}</version>
246             <type>zip</type>
247             <classifier>repo</classifier>
248         </dependency>
249     </dependencies>
250
251     <build>
252         <plugins>
253             <plugin>
254                 <groupId>org.codehaus.groovy.maven</groupId>
255                 <artifactId>gmaven-plugin</artifactId>
256                 <version>1.0</version>
257                 <executions>
258                     <execution>
259                         <phase>validate</phase>
260                         <goals>
261                             <goal>execute</goal>
262                         </goals>
263                         <configuration>
264                             <source>${basedir}/../../src/main/scripts/TagSnapshotVersion.groovy</source>
265                         </configuration>
266                     </execution>
267                 </executions>
268             </plugin>
269             <plugin>
270                 <artifactId>maven-resources-plugin</artifactId>
271                 <version>2.6</version>
272                 <executions>
273                     <execution>
274                         <id>copy-dockerfile</id>
275                         <goals>
276                             <goal>copy-resources</goal>
277                         </goals>
278                         <!-- here the phase you need -->
279                         <phase>validate</phase>
280                         <configuration>
281                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
282                             <resources>
283                                 <resource>
284                                     <directory>src/main/docker</directory>
285                                     <includes>
286                                         <include>Dockerfile</include>
287                                     </includes>
288                                     <filtering>true</filtering>
289                                 </resource>
290                             </resources>
291                         </configuration>
292                     </execution>
293                     <execution>
294                         <id>copy-scripts</id>
295                         <goals>
296                             <goal>copy-resources</goal>
297                         </goals>
298                         <!-- here the phase you need -->
299                         <phase>validate</phase>
300                         <configuration>
301                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/bin</outputDirectory>
302                             <resources>
303                                 <resource>
304                                     <directory>../src/main/scripts</directory>
305                                     <includes>
306                                         <include>*.sh</include>
307                                     </includes>
308                                     <filtering>false</filtering>
309                                 </resource>
310                             </resources>
311                         </configuration>
312                     </execution>
313                     <execution>
314                         <id>copy-odl-resources</id>
315                         <goals>
316                             <goal>copy-resources</goal>
317                         </goals>
318                         <!-- here the phase you need -->
319                         <phase>validate</phase>
320                         <configuration>
321                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
322                             <resources>
323                                 <resource>
324                                     <directory>../src/main/resources</directory>
325                                     <includes>
326                                         <include>idmlight.db.mv.db</include>
327                                         <include>org.ops4j.pax.logging.cfg</include>
328                                         <include>install_ccsdk.yml</include>
329                                         <include>ansible-sources.list</include>
330                                     </includes>
331                                     <filtering>false</filtering>
332                                 </resource>
333                             </resources>
334                         </configuration>
335                     </execution>
336                     <execution>
337                         <id>copy-config</id>
338                         <goals>
339                             <goal>copy-resources</goal>
340                         </goals>
341                         <!-- here the phase you need -->
342                         <phase>validate</phase>
343                         <configuration>
344                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
345                             <resources>
346                                 <resource>
347                                     <directory>../src/main/resources</directory>
348                                     <includes>
349                                         <include>org.ops4j.pax.logging.cfg</include>
350                                     </includes>
351                                     <filtering>false</filtering>
352                                 </resource>
353                             </resources>
354                         </configuration>
355                     </execution>
356                     <execution>
357                         <id>copy-data</id>
358                         <goals>
359                             <goal>copy-resources</goal>
360                         </goals>
361                         <!-- here the phase you need -->
362                         <phase>validate</phase>
363                         <configuration>
364                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/data</outputDirectory>
365                             <resources>
366                                 <resource>
367                                     <directory>../src/main/resources</directory>
368                                     <includes>
369                                         <include>*.dump</include>
370                                     </includes>
371                                     <filtering>false</filtering>
372                                 </resource>
373                             </resources>
374                         </configuration>
375                     </execution>
376                     <execution>
377                         <id>copy-properties</id>
378                         <goals>
379                             <goal>copy-resources</goal>
380                         </goals>
381                         <!-- here the phase you need -->
382                         <phase>validate</phase>
383                         <configuration>
384                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/data/properties
385                             </outputDirectory>
386                             <resources>
387                                 <resource>
388                                     <directory>../src/main/properties</directory>
389                                     <includes>
390                                         <include>*.properties</include>
391                                         <include>*.vt</include>
392                                     </includes>
393                                     <filtering>false</filtering>
394                                 </resource>
395                             </resources>
396                         </configuration>
397                     </execution>
398                     <execution>
399                         <id>copy-keystores</id>
400                         <goals>
401                             <goal>copy-resources</goal>
402                         </goals>
403                         <!-- here the phase you need -->
404                         <phase>validate</phase>
405                         <configuration>
406                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/data/stores</outputDirectory>
407                             <resources>
408                                 <resource>
409                                     <directory>../src/main/stores</directory>
410                                     <includes>
411                                         <include>*.jks</include>
412                                     </includes>
413                                     <filtering>false</filtering>
414                                 </resource>
415                             </resources>
416                         </configuration>
417                     </execution>
418                 </executions>
419             </plugin>
420             <plugin>
421                 <groupId>org.apache.maven.plugins</groupId>
422                 <artifactId>maven-dependency-plugin</artifactId>
423                 <version>3.0.2</version>
424                 <executions>
425                     <execution>
426                         <id>unpack features</id>
427                         <phase>generate-sources</phase>
428                         <goals>
429                             <goal>unpack-dependencies</goal>
430                         </goals>
431                         <configuration>
432                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
433                             <excludeTransitive>true</excludeTransitive>
434                         </configuration>
435                     </execution>
436                     <execution>
437                         <id>unpack dgs</id>
438                         <phase>generate-sources</phase>
439                         <goals>
440                             <goal>unpack</goal>
441                         </goals>
442                         <configuration>
443                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk</outputDirectory>
444                             <artifactItems>
445                                 <artifactItem>
446                                     <groupId>${project.groupId}</groupId>
447                                     <artifactId>platform-logic-installer</artifactId>
448                                     <version>${project.version}</version>
449                                     <type>zip</type>
450                                 </artifactItem>
451                             </artifactItems>
452                         </configuration>
453                     </execution>
454                 </executions>
455             </plugin>
456             <plugin>
457                 <groupId>org.apache.maven.plugins</groupId>
458                 <artifactId>maven-antrun-plugin</artifactId>
459                 <version>1.8</version>
460                 <executions>
461                     <execution>
462                         <id>change-shell-permissions</id>
463                         <phase>process-sources</phase>
464                         <configuration>
465                             <target>
466                                 <chmod dir="${basedir}/target/docker-stage/opt/onap/ccsdk" perm="+x" includes="**/*.sh"/>
467                             </target>
468                         </configuration>
469                         <goals>
470                             <goal>run</goal>
471                         </goals>
472                     </execution>
473                 </executions>
474             </plugin>
475             <plugin>
476                 <groupId>org.apache.maven.plugins</groupId>
477                 <artifactId>maven-failsafe-plugin</artifactId>
478                 <executions>
479                     <execution>
480                         <goals>
481                             <goal>integration-test</goal>
482                             <goal>verify</goal>
483                         </goals>
484                     </execution>
485                 </executions>
486                 <configuration>
487                     <skipITs>true</skipITs>
488                 </configuration>
489             </plugin>
490         </plugins>
491         <extensions>
492             <extension><!-- this extension is required by wagon in order to pass the proxy -->
493                 <groupId>org.apache.maven.wagon</groupId>
494                 <artifactId>wagon-http-lightweight</artifactId>
495                 <version>2.2</version>
496             </extension>
497         </extensions>
498     </build>
499
500     <profiles>
501         <profile>
502             <id>docker</id>
503             <build>
504                 <plugins>
505                     <plugin>
506                         <groupId>org.apache.maven.plugins</groupId>
507                         <artifactId>maven-failsafe-plugin</artifactId>
508                         <executions>
509                             <execution>
510                                 <goals>
511                                     <goal>integration-test</goal>
512                                     <goal>verify</goal>
513                                 </goals>
514                             </execution>
515                         </executions>
516                         <configuration>
517                             <skipITs>false</skipITs>
518                             <environmentVariables>
519                                 <ODLSLI_PORT>${odlsli.port}</ODLSLI_PORT>
520                             </environmentVariables>
521                         </configuration>
522                     </plugin>
523                     <plugin>
524                         <groupId>io.fabric8</groupId>
525                         <artifactId>docker-maven-plugin</artifactId>
526                         <version>0.34.0</version>
527                         <inherited>false</inherited>
528                         <configuration>
529                             <images>
530                                 <image>
531                                     <name>${image.name}</name>
532                                     <build>
533                                         <cleanup>try</cleanup>
534                                         <noCache>true</noCache>
535                                         <contextDir>${basedir}/target/docker-stage</contextDir>
536                                         <dockerFile>Dockerfile</dockerFile>
537                                         <tags>
538                                             <tag>${project.docker.latestminortag.snapshot.version}</tag>
539                                             <tag>${project.docker.latestfulltag.snapshot.version}</tag>
540                                             <tag>${project.docker.latesttagtimestamp.snapshot.version}</tag>
541                                         </tags>
542                                     </build>
543                                 </image>
544                             </images>
545                             <verbose>${docker.verbose}</verbose>
546                             <skipPush>${docker.skip.push}</skipPush>
547                         </configuration>
548                         <executions>
549                             <execution>
550                                 <id>build-push-images</id>
551                                 <goals>
552                                     <goal>build</goal>
553                                     <goal>push</goal>
554                                 </goals>
555                             </execution>
556                         </executions>
557                     </plugin>
558                 </plugins>
559             </build>
560         </profile>
561     </profiles>
562 </project>