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.1.7-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                         <phase>${docker.push.phase}</phase>
134                         <goals>
135                             <goal>build</goal>
136                             <goal>push</goal>
137                         </goals>
138                     </execution>
139                 </executions>
140             </plugin>
141             <plugin>
142                 <artifactId>maven-resources-plugin</artifactId>
143                 <version>2.6</version>
144                 <executions>
145                     <execution>
146                         <id>copy-dockerfile</id>
147                         <goals>
148                             <goal>copy-resources</goal>
149                         </goals><!-- here the phase you need -->
150                         <phase>validate</phase>
151                         <configuration>
152                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
153                             <resources>
154                                 <resource>
155                                     <directory>src/main/docker</directory>
156                                     <includes>
157                                         <include>Dockerfile</include>
158                                     </includes>
159                                     <filtering>true</filtering>
160                                 </resource>
161                             </resources>
162                         </configuration>
163                     </execution>
164                     <execution>
165                         <id>copy-scripts</id>
166                         <goals>
167                             <goal>copy-resources</goal>
168                         </goals><!-- here the phase you need -->
169                         <phase>validate</phase>
170                         <configuration>
171                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/bin</outputDirectory>
172                             <resources>
173                                 <resource>
174                                     <directory>src/main/scripts</directory>
175                                     <includes>
176                                         <include>*.py</include>
177                                         <include>*.sh</include>
178                                     </includes>
179                                     <filtering>true</filtering>
180                                 </resource>
181                             </resources>
182                         </configuration>
183                     </execution>
184                     <execution>
185                         <id>copy-tarballs</id>
186                         <goals>
187                             <goal>copy-resources</goal>
188                         </goals><!-- here the phase you need -->
189                         <phase>validate</phase>
190                         <configuration>
191                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
192                             <resources>
193                                 <resource>
194                                     <directory>src/main/resources</directory>
195                                     <includes>
196                                         <include>idmlight.db.mv.db</include>
197                                         <include>truststoreONAPall.jks</include>
198                                         <include>aaa-app-config.xml</include>
199                                     </includes>
200                                     <filtering>false</filtering>
201                                 </resource>
202                             </resources>
203                         </configuration>
204                     </execution>
205                     <execution>
206                         <id>copy-data</id>
207                         <goals>
208                             <goal>copy-resources</goal>
209                         </goals><!-- here the phase you need -->
210                         <phase>validate</phase>
211                         <configuration>
212                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data</outputDirectory>
213                             <resources>
214                                 <resource>
215                                     <directory>src/main/resources</directory>
216                                     <includes>
217                                         <include>*.dump</include>
218                                         <include>oauth-aaa-app-config.xml</include>
219                                     </includes>
220                                     <filtering>false</filtering>
221                                 </resource>
222                             </resources>
223                         </configuration>
224                     </execution>
225                     <execution>
226                         <id>copy-properties</id>
227                         <goals>
228                             <goal>copy-resources</goal>
229                         </goals><!-- here the phase you need -->
230                         <phase>validate</phase>
231                         <configuration>
232                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</outputDirectory>
233                             <resources>
234                                 <resource>
235                                     <directory>../src/main/properties</directory>
236                                     <includes>
237                                         <include>*.properties</include>
238                                         <include>*.props</include>
239                                         <include>*.csv</include>
240                                     </includes>
241                                     <filtering>false</filtering>
242                                 </resource>
243                             </resources>
244                         </configuration>
245                     </execution>
246                     <execution>
247                         <id>copy-keystores</id>
248                         <goals>
249                             <goal>copy-resources</goal>
250                         </goals><!-- here the phase you need -->
251                         <phase>validate</phase>
252                         <configuration>
253                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/stores</outputDirectory>
254                             <resources>
255                                 <resource>
256                                     <directory>../src/main/stores</directory>
257                                     <includes>
258                                         <include>*.jks</include>
259                                         <include>*.keyfile</include>
260                                         <include>*.p12</include>
261                                     </includes>
262                                     <filtering>false</filtering>
263                                 </resource>
264                             </resources>
265                         </configuration>
266                     </execution>
267                 </executions>
268             </plugin>
269             <plugin>
270                 <groupId>org.apache.maven.plugins</groupId>
271                 <artifactId>maven-dependency-plugin</artifactId>
272                 <version>3.0.2</version>
273                 <executions>
274                     <execution>
275                         <id>unpack-sdnc-features</id>
276                         <phase>generate-sources</phase>
277                         <goals>
278                             <goal>unpack-dependencies</goal>
279                         </goals>
280                         <configuration>
281                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
282                             <excludeTransitive>true</excludeTransitive>
283                         </configuration>
284                     </execution>
285                     <execution>
286                         <id>unpack-platform-logic</id>
287                         <phase>generate-sources</phase>
288                         <goals>
289                             <goal>unpack</goal>
290                         </goals>
291                         <configuration>
292                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc</outputDirectory>
293                             <artifactItems>
294                                 <artifactItem>
295                                     <groupId>${project.groupId}</groupId>
296                                     <artifactId>platform-logic-installer</artifactId>
297                                     <version>${project.version}</version>
298                                     <type>zip</type>
299                                 </artifactItem>
300                             </artifactItems>
301                         </configuration>
302                     </execution>
303                     <execution>
304                         <id>unpack-data-migrator</id>
305                         <phase>generate-sources</phase>
306                         <goals>
307                             <goal>unpack</goal>
308                         </goals>
309                         <configuration>
310                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data-migrator</outputDirectory>
311                             <artifactItems>
312                                 <artifactItem>
313                                     <groupId>org.onap.sdnc.oam</groupId>
314                                     <artifactId>data-migrator</artifactId>
315                                     <version>${project.version}</version>
316                                     <type>zip</type>
317                                 </artifactItem>
318                             </artifactItems>
319                         </configuration>
320                     </execution>
321                 </executions>
322             </plugin>
323             <plugin>
324                 <groupId>org.apache.maven.plugins</groupId>
325                 <artifactId>maven-antrun-plugin</artifactId>
326                 <version>1.8</version>
327                 <executions>
328                     <execution>
329                         <id>change-shell-permissions</id>
330                         <phase>process-sources</phase>
331                         <configuration>
332                             <target>
333                                 <chmod dir="${basedir}/target/docker-stage/opt/onap/sdnc" perm="+x" includes="**/*.sh"/>
334                             </target>
335                         </configuration>
336                         <goals>
337                             <goal>run</goal>
338                         </goals>
339                     </execution>
340                 </executions>
341             </plugin>
342             <plugin>
343                 <groupId>org.apache.maven.plugins</groupId>
344                 <artifactId>maven-failsafe-plugin</artifactId>
345                 <executions>
346                     <execution>
347                         <goals>
348                             <goal>integration-test</goal>
349                             <goal>verify</goal>
350                         </goals>
351                     </execution>
352                 </executions>
353                 <configuration>
354                     <skipITs>false</skipITs>
355                     <environmentVariables>
356                         <SDNC_PORT>${sdnc.port}</SDNC_PORT>
357                     </environmentVariables>
358                 </configuration>
359             </plugin>
360         </plugins>
361     </build>
362 </project>