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