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