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