Effort to reduce image layer and size
[sdnc/oam.git] / installation / sdnc / 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.sdnc.oam</groupId>
7         <artifactId>installation</artifactId>
8         <version>2.2.0-SNAPSHOT</version>
9     </parent>
10
11     <artifactId>installation-sdnc</artifactId>
12     <packaging>pom</packaging>
13
14     <name>sdnc-oam :: installation :: ${project.artifactId}</name>
15     <description>Creates SDN Controller Docker container</description>
16     <organization>
17         <name>ONAP</name>
18     </organization>
19
20     <properties>
21         <image.name>onap/sdnc-aaf-image</image.name>
22         <standalone.image.name>onap/sdnc-image</standalone.image.name>
23         <ccsdk.docker.version>${ccsdk.docker.odlsli.alpine.version}</ccsdk.docker.version>
24         <sdnc.keystore>org.onap.sdnc.p12</sdnc.keystore>
25         <sdnc.keypass><![CDATA[;:G58,7ZhqOSI:7^oZCY[9Dv]]></sdnc.keypass>
26         <sdnc.secureport>8443</sdnc.secureport>
27
28         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
29         <sdnc.build.timestamp>${maven.build.timestamp}</sdnc.build.timestamp>
30
31         <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
32         <docker.autoCreateCustomNetworks>true</docker.autoCreateCustomNetworks>
33     </properties>
34
35     <dependencies>
36         <dependency>
37             <groupId>org.onap.sdnc.northbound</groupId>
38             <artifactId>generic-resource-api-installer</artifactId>
39             <version>${sdnc.northbound.version}</version>
40             <type>zip</type>
41             <classifier>repo</classifier>
42         </dependency>
43         <dependency>
44             <groupId>org.onap.sdnc.northbound</groupId>
45             <artifactId>optical-service-installer</artifactId>
46             <version>${sdnc.northbound.version}</version>
47             <type>zip</type>
48             <classifier>repo</classifier>
49         </dependency>
50         <dependency>
51             <groupId>org.onap.sdnc.northbound</groupId>
52             <artifactId>vnftools-installer</artifactId>
53             <version>${sdnc.northbound.version}</version>
54             <type>zip</type>
55             <classifier>repo</classifier>
56         </dependency>
57         <dependency>
58             <groupId>org.onap.sdnc.northbound</groupId>
59             <artifactId>sdnc-northbound-features-installer</artifactId>
60             <version>${sdnc.northbound.version}</version>
61             <type>zip</type>
62             <classifier>repo</classifier>
63         </dependency>
64     </dependencies>
65
66     <build>
67         <plugins>
68             <plugin>
69                 <groupId>org.codehaus.groovy.maven</groupId>
70                 <artifactId>gmaven-plugin</artifactId>
71                 <version>1.0</version>
72                 <executions>
73                     <execution>
74                         <phase>validate</phase>
75                         <goals>
76                             <goal>execute</goal>
77                         </goals>
78                         <configuration>
79                             <source>${basedir}/../TagVersion.groovy</source>
80                         </configuration>
81                     </execution>
82                 </executions>
83             </plugin>
84
85             <plugin>
86                 <groupId>io.fabric8</groupId>
87                 <artifactId>docker-maven-plugin</artifactId>
88                 <version>0.34.0</version>
89                 <inherited>false</inherited>
90                 <configuration>
91                     <images>
92                         <image>
93                             <name>${image.name}</name>
94                             <build>
95                                 <cleanup>try</cleanup>
96                                 <noCache>true</noCache>
97                                 <contextDir>${basedir}/target/docker-stage</contextDir>
98                                 <dockerFile>Dockerfile</dockerFile>
99                                 <args>
100                                     <AAF>true</AAF>
101                                 </args>
102                                 <tags>
103                                     <tag>${project.docker.latestminortag.version}</tag>
104                                     <tag>${project.docker.latestfulltag.version}</tag>
105                                     <tag>${project.docker.latesttagtimestamp.version}</tag>
106                                 </tags>
107                             </build>
108                         </image>
109                         <image>
110                             <name>${standalone.image.name}</name>
111                             <build>
112                                 <cleanup>try</cleanup>
113                                 <noCache>true</noCache>
114                                 <contextDir>${basedir}/target/docker-stage</contextDir>
115                                 <dockerFile>Dockerfile</dockerFile>
116                                 <args>
117                                     <AAF>false</AAF>
118                                 </args>
119                                 <tags>
120                                     <tag>${project.docker.latestminortag.version}</tag>
121                                     <tag>${project.docker.latestfulltag.version}</tag>
122                                     <tag>${project.docker.latesttagtimestamp.version}</tag>
123                                 </tags>
124                             </build>
125                         </image>
126                     </images>
127                     <verbose>${docker.verbose}</verbose>
128                     <skipPush>${docker.skip.push}</skipPush>
129                 </configuration>
130                 <executions>
131                     <execution>
132                         <id>build-push-images</id>
133                         <goals>
134                             <goal>build</goal>
135                             <goal>push</goal>
136                         </goals>
137                     </execution>
138                 </executions>
139             </plugin>
140             <plugin>
141                 <artifactId>maven-resources-plugin</artifactId>
142                 <version>2.6</version>
143                 <executions>
144                     <execution>
145                         <id>copy-dockerfile</id>
146                         <goals>
147                             <goal>copy-resources</goal>
148                         </goals><!-- here the phase you need -->
149                         <phase>validate</phase>
150                         <configuration>
151                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
152                             <resources>
153                                 <resource>
154                                     <directory>src/main/docker</directory>
155                                     <includes>
156                                         <include>Dockerfile</include>
157                                     </includes>
158                                     <filtering>true</filtering>
159                                 </resource>
160                             </resources>
161                         </configuration>
162                     </execution>
163                     <execution>
164                         <id>copy-scripts</id>
165                         <goals>
166                             <goal>copy-resources</goal>
167                         </goals><!-- here the phase you need -->
168                         <phase>validate</phase>
169                         <configuration>
170                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/bin</outputDirectory>
171                             <resources>
172                                 <resource>
173                                     <directory>src/main/scripts</directory>
174                                     <includes>
175                                         <include>*.py</include>
176                                         <include>*.sh</include>
177                                     </includes>
178                                     <filtering>true</filtering>
179                                 </resource>
180                             </resources>
181                         </configuration>
182                     </execution>
183                     <execution>
184                         <id>copy-tarballs</id>
185                         <goals>
186                             <goal>copy-resources</goal>
187                         </goals><!-- here the phase you need -->
188                         <phase>validate</phase>
189                         <configuration>
190                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
191                             <resources>
192                                 <resource>
193                                     <directory>src/main/resources</directory>
194                                     <includes>
195                                         <include>idmlight.db.mv.db</include>
196                                         <include>truststoreONAPall.jks</include>
197                                         <include>aaa-app-config.xml</include>
198                                     </includes>
199                                     <filtering>false</filtering>
200                                 </resource>
201                             </resources>
202                         </configuration>
203                     </execution>
204                     <execution>
205                         <id>copy-data</id>
206                         <goals>
207                             <goal>copy-resources</goal>
208                         </goals><!-- here the phase you need -->
209                         <phase>validate</phase>
210                         <configuration>
211                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data</outputDirectory>
212                             <resources>
213                                 <resource>
214                                     <directory>src/main/resources</directory>
215                                     <includes>
216                                         <include>*.dump</include>
217                                         <include>oauth-aaa-app-config.xml</include>
218                                     </includes>
219                                     <filtering>false</filtering>
220                                 </resource>
221                             </resources>
222                         </configuration>
223                     </execution>
224                     <execution>
225                         <id>copy-properties</id>
226                         <goals>
227                             <goal>copy-resources</goal>
228                         </goals><!-- here the phase you need -->
229                         <phase>validate</phase>
230                         <configuration>
231                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</outputDirectory>
232                             <resources>
233                                 <resource>
234                                     <directory>../src/main/properties</directory>
235                                     <includes>
236                                         <include>*.properties</include>
237                                         <include>*.props</include>
238                                         <include>*.csv</include>
239                                     </includes>
240                                     <filtering>false</filtering>
241                                 </resource>
242                             </resources>
243                         </configuration>
244                     </execution>
245                     <execution>
246                         <id>copy-keystores</id>
247                         <goals>
248                             <goal>copy-resources</goal>
249                         </goals><!-- here the phase you need -->
250                         <phase>validate</phase>
251                         <configuration>
252                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/stores</outputDirectory>
253                             <resources>
254                                 <resource>
255                                     <directory>../src/main/stores</directory>
256                                     <includes>
257                                         <include>*.jks</include>
258                                         <include>*.keyfile</include>
259                                         <include>*.p12</include>
260                                     </includes>
261                                     <filtering>false</filtering>
262                                 </resource>
263                             </resources>
264                         </configuration>
265                     </execution>
266                 </executions>
267             </plugin>
268             <plugin>
269                 <groupId>org.apache.maven.plugins</groupId>
270                 <artifactId>maven-dependency-plugin</artifactId>
271                 <version>3.0.2</version>
272                 <executions>
273                     <execution>
274                         <id>unpack-sdnc-features</id>
275                         <phase>generate-sources</phase>
276                         <goals>
277                             <goal>unpack-dependencies</goal>
278                         </goals>
279                         <configuration>
280                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
281                             <excludeTransitive>true</excludeTransitive>
282                         </configuration>
283                     </execution>
284                     <execution>
285                         <id>unpack-platform-logic</id>
286                         <phase>generate-sources</phase>
287                         <goals>
288                             <goal>unpack</goal>
289                         </goals>
290                         <configuration>
291                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc</outputDirectory>
292                             <artifactItems>
293                                 <artifactItem>
294                                     <groupId>${project.groupId}</groupId>
295                                     <artifactId>platform-logic-installer</artifactId>
296                                     <version>${project.version}</version>
297                                     <type>zip</type>
298                                 </artifactItem>
299                             </artifactItems>
300                         </configuration>
301                     </execution>
302                     <execution>
303                         <id>unpack-data-migrator</id>
304                         <phase>generate-sources</phase>
305                         <goals>
306                             <goal>unpack</goal>
307                         </goals>
308                         <configuration>
309                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data-migrator</outputDirectory>
310                             <artifactItems>
311                                 <artifactItem>
312                                     <groupId>org.onap.sdnc.oam</groupId>
313                                     <artifactId>data-migrator</artifactId>
314                                     <version>${project.version}</version>
315                                     <type>zip</type>
316                                 </artifactItem>
317                             </artifactItems>
318                         </configuration>
319                     </execution>
320                 </executions>
321             </plugin>
322             <plugin>
323                 <groupId>org.apache.maven.plugins</groupId>
324                 <artifactId>maven-antrun-plugin</artifactId>
325                 <version>1.8</version>
326                 <executions>
327                     <execution>
328                         <id>change-shell-permissions</id>
329                         <phase>process-sources</phase>
330                         <configuration>
331                             <target>
332                                 <chmod dir="${basedir}/target/docker-stage/opt/onap/sdnc" perm="+x" includes="**/*.sh"/>
333                             </target>
334                         </configuration>
335                         <goals>
336                             <goal>run</goal>
337                         </goals>
338                     </execution>
339                 </executions>
340             </plugin>
341             <plugin>
342                 <groupId>org.apache.maven.plugins</groupId>
343                 <artifactId>maven-failsafe-plugin</artifactId>
344                 <executions>
345                     <execution>
346                         <goals>
347                             <goal>integration-test</goal>
348                             <goal>verify</goal>
349                         </goals>
350                     </execution>
351                 </executions>
352                 <configuration>
353                     <skipITs>false</skipITs>
354                     <environmentVariables>
355                         <SDNC_PORT>${sdnc.port}</SDNC_PORT>
356                     </environmentVariables>
357                 </configuration>
358             </plugin>
359         </plugins>
360     </build>
361 </project>