3982e23e22c71a08b458cffe1d0249b6682912a4
[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                                         <!-- Two commented execution tags below 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                                         <execution>
99                                                 <id>copy-keystores</id>
100                                                 <goals>
101                                                         <goal>copy-resources</goal>
102                                                 </goals>
103                                                 <phase>validate</phase>
104                                                 <configuration>
105                                                         <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/sdnc/data/stores</outputDirectory>
106                                                         <resources>
107                                                                 <resource>
108                                                                         <directory>../src/main/stores</directory>
109                                                                         <includes>
110                                                                                 <include>*.jks</include>
111                                                                         </includes>
112                                                                         <filtering>false</filtering>
113                                                                 </resource>
114                                                         </resources>
115                                                 </configuration>
116                                         </execution>-->
117                                         
118                                         <execution>
119                                                 <id>copy-properties</id>
120                                                 <goals>
121                                                         <goal>copy-resources</goal>
122                                                 </goals>
123                                                 <phase>validate</phase>
124                                                 <configuration>
125                                                         <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/appc/data/properties</outputDirectory>
126                                                         <resources>
127                                                                 <resource>
128                                                                         <directory>../src/main/appc-properties</directory>
129                                                                         <includes>
130                                                                                 <include>*.properties</include>
131                                                                         </includes>
132                                                                         <filtering>false</filtering>
133                                                                 </resource>
134                                                         </resources>
135                                                 </configuration>
136                                         </execution>
137                                 </executions>
138                         </plugin>
139                         <plugin>
140                                 <artifactId>exec-maven-plugin</artifactId>
141                                 <groupId>org.codehaus.mojo</groupId>
142                                 <version>1.5.0</version>
143                                 <executions>
144                                         <execution>
145                                                 <id>Get features</id>
146                                                 <phase>generate-sources</phase>
147                                                 <goals>
148                                                         <goal>exec</goal>
149                                                 </goals>
150                                                 <configuration>
151                                                         <executable>bash</executable>
152                                                         <environmentVariables>
153                                                                 <APPC_VERSION>${appc.version}</APPC_VERSION>
154                                                                 <APPC_OAM_VERSION>${project.version}</APPC_OAM_VERSION>
155                                                                 <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION>
156                                                         </environmentVariables>
157                                                         <arguments>
158                                                                 <argument>${basedir}/src/main/scripts/installZips.sh</argument>
159                                                                 <argument>${basedir}/target/docker-stage/opt/openecomp/appc</argument>
160                                                         </arguments>
161                                                 </configuration>
162                                         </execution>
163
164                                         <execution>
165                                                 <id>change shell permissions</id>
166                                                 <phase>process-sources</phase>
167                                                 <goals>
168                                                         <goal>exec</goal>
169                                                 </goals>
170                                                 <configuration>
171                                                         <executable>find</executable>
172                                                         <arguments>
173                                                                 <argument>${basedir}/target/docker-stage/opt/openecomp/appc</argument>
174                                                                 <argument>-name</argument>
175                                                                 <argument>*.sh</argument>
176                                                                 <argument>-exec</argument>
177                                                                 <argument>chmod</argument>
178                                                                 <argument>+x</argument>
179                                                                 <argument>{}</argument>
180                                                                 <argument>;</argument>
181                                                         </arguments>
182                                                 </configuration>
183                                         </execution>
184                                 </executions>
185                         </plugin>
186                 </plugins>
187         </build>
188
189         <profiles>
190                 <profile>
191                         <id>docker</id>
192                         <build>
193                                 <plugins>
194                                         <plugin>
195                                                 <groupId>org.codehaus.groovy.maven</groupId>
196                                                 <artifactId>gmaven-plugin</artifactId>
197                                                 <executions>
198                                                         <execution>
199                                                                 <phase>validate</phase>
200                                                                 <goals>
201                                                                         <goal>execute</goal>
202                                                                 </goals>
203                                                                 <configuration>
204                                                                         <properties>
205                                                                                 <ver>${project.version}</ver>
206                                                                                 <timestamp>${maven.build.timestamp}</timestamp>
207                                                                         </properties>
208                                                                         <source>
209                                                                                 println project.properties['ver'];
210                                                                                 def versionArray;
211                                                                                 if ( project.properties['ver'] != null ) {
212                                                                                 versionArray = project.properties['ver'].split('\\.');
213                                                                                 }
214                                                                                 if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
215                                                                                 project.properties['dockertag1']=project.properties['ver'] + "-latest";
216                                                                                 project.properties['dockertag2']="latest";
217                                                                                 } else {
218                                                                                 project.properties['dockertag1']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
219                                                                                 project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
220                                                                                 }
221                                                                                 println 'docker tag 1: ' + project.properties['dockertag1'];
222                                                                                 println 'docker tag 2: ' + project.properties['dockertag2'];
223                                                                         </source>
224                                                                 </configuration>
225                                                         </execution>
226                                                 </executions>
227                                         </plugin>
228                                         <plugin>
229                                                 <groupId>io.fabric8</groupId>
230                                                 <artifactId>docker-maven-plugin</artifactId>
231                                                 <version>0.16.5</version>
232                                                 <inherited>false</inherited>
233                                                 <configuration>
234                                                         <images>
235                                                                 <image>
236                                                                         <name>${image.name}</name>
237                                                                         <build>
238                                                                                 <cleanup>try</cleanup>
239                                                                                 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
240                                                                                 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
241                                                                                 <tags>
242                                                                                         <tag>${dockertag1}</tag>
243                                                                                         <tag>${dockertag2}</tag>
244                                                                                 </tags>
245                                                                         </build>
246                                                                 </image>
247                                                         </images>
248                                                 </configuration>
249                                                 <executions>
250                                                         <execution>
251                                                                 <id>generate-images</id>
252                                                                 <phase>package</phase>
253                                                                 <goals>
254                                                                         <goal>build</goal>
255                                                                 </goals>
256                                                         </execution>
257
258                                                         <execution>
259                                                                 <id>push-images</id>
260                                                                 <phase>deploy</phase>
261                                                                 <goals>
262                                                                         <goal>build</goal>
263                                                                         <goal>push</goal>
264                                                                 </goals>
265                                                         </execution>
266                                                 </executions>
267                                         </plugin>
268
269                                         <!-- This is to add any extra scripts, sql dump files, properties files 
270                                                 APPC may need even after inheriting from the sdnc base image -->
271                                         <plugin>
272                                                 <artifactId>maven-resources-plugin</artifactId>
273                                                 <version>2.6</version>
274                                                 <executions>
275                                                         <execution>
276                                                                 <id>copy-dockerfile</id>
277                                                                 <goals>
278                                                                         <goal>copy-resources</goal>
279                                                                 </goals><!-- here the phase you need -->
280                                                                 <phase>validate</phase>
281                                                                 <configuration>
282                                                                         <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
283                                                                         <resources>
284                                                                                 <resource>
285                                                                                         <directory>src/main/docker</directory>
286                                                                                         <includes>
287                                                                                                 <include>Dockerfile</include>
288                                                                                         </includes>
289                                                                                         <filtering>true</filtering>
290                                                                                 </resource>
291                                                                         </resources>
292                                                                 </configuration>
293                                                         </execution>
294
295                                                         <execution>
296                                                                 <id>copy-scripts</id>
297                                                                 <goals>
298                                                                         <goal>copy-resources</goal>
299                                                                 </goals><!-- here the phase you need -->
300                                                                 <phase>validate</phase>
301                                                                 <configuration>
302                                                                         <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/appc/bin</outputDirectory>
303                                                                         <resources>
304                                                                                 <resource>
305                                                                                         <directory>src/main/scripts</directory>
306                                                                                         <includes>
307                                                                                                 <include>*.sh</include>
308                                                                                         </includes>
309                                                                                         <filtering>false</filtering>
310                                                                                 </resource>
311                                                                         </resources>
312                                                                 </configuration>
313                                                         </execution>
314
315                                                         <!-- Two commented execution tags below in case / when appc needs 
316                                                                 to add .dump mysql files or keystore files -->
317                                                         <!--<execution> <id>copy-data</id> <goals> <goal>copy-resources</goal> 
318                                                                 </goals> <phase>validate</phase> <configuration> <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/sdnc/data</outputDirectory> 
319                                                                 <resources> <resource> <directory>src/main/resources</directory> <includes> 
320                                                                 <include>*.dump</include> </includes> <filtering>false</filtering> </resource> 
321                                                                 </resources> </configuration> </execution> <execution> <id>copy-keystores</id> 
322                                                                 <goals> <goal>copy-resources</goal> </goals> <phase>validate</phase> <configuration> 
323                                                                 <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/sdnc/data/stores</outputDirectory> 
324                                                                 <resources> <resource> <directory>../src/main/stores</directory> <includes> 
325                                                                 <include>*.jks</include> </includes> <filtering>false</filtering> </resource> 
326                                                                 </resources> </configuration> </execution> -->
327
328                                                         <execution>
329                                                                 <id>copy-properties</id>
330                                                                 <goals>
331                                                                         <goal>copy-resources</goal>
332                                                                 </goals>
333                                                                 <phase>validate</phase>
334                                                                 <configuration>
335                                                                         <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/appc/data/properties</outputDirectory>
336                                                                         <resources>
337                                                                                 <resource>
338                                                                                         <directory>../src/main/appc-properties</directory>
339                                                                                         <includes>
340                                                                                                 <include>*.properties</include>
341                                                                                         </includes>
342                                                                                         <filtering>false</filtering>
343                                                                                 </resource>
344                                                                         </resources>
345                                                                 </configuration>
346                                                         </execution>
347                                                 </executions>
348                                         </plugin>
349                                         <plugin>
350                                                 <artifactId>exec-maven-plugin</artifactId>
351                                                 <groupId>org.codehaus.mojo</groupId>
352                                                 <version>1.5.0</version>
353                                                 <executions>
354                                                         <execution>
355                                                                 <id>Get features</id>
356                                                                 <phase>generate-sources</phase>
357                                                                 <goals>
358                                                                         <goal>exec</goal>
359                                                                 </goals>
360                                                                 <configuration>
361                                                                         <executable>bash</executable>
362                                                                         <environmentVariables>
363                                                                                 <APPC_VERSION>${appc.version}</APPC_VERSION>
364                                                                                 <APPC_OAM_VERSION>${project.version}</APPC_OAM_VERSION>
365                                                                                 <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION>
366                                                                         </environmentVariables>
367                                                                         <arguments>
368                                                                                 <argument>${basedir}/src/main/scripts/installZips.sh</argument>
369                                                                                 <argument>${basedir}/target/docker-stage/opt/openecomp/appc</argument>
370                                                                         </arguments>
371                                                                 </configuration>
372                                                         </execution>
373
374                                                         <execution>
375                                                                 <id>change shell permissions</id>
376                                                                 <phase>process-sources</phase>
377                                                                 <goals>
378                                                                         <goal>exec</goal>
379                                                                 </goals>
380                                                                 <configuration>
381                                                                         <executable>/usr/bin/find</executable>
382                                                                         <arguments>
383                                                                                 <argument>${basedir}/target/docker-stage/opt/openecomp/appc</argument>
384                                                                                 <argument>-name</argument>
385                                                                                 <argument>*.sh</argument>
386                                                                                 <argument>-exec</argument>
387                                                                                 <argument>chmod</argument>
388                                                                                 <argument>+x</argument>
389                                                                                 <argument>{}</argument>
390                                                                                 <argument>;</argument>
391                                                                         </arguments>
392                                                                 </configuration>
393                                                         </execution>
394                                                 </executions>
395                                         </plugin>
396                                 </plugins>
397                         </build>
398
399                 </profile>
400         </profiles>
401         
402         <organization>
403                 <name>openECOMP</name>
404         </organization>
405         
406 </project>