ee8242d1a08e3cc656f3968e2f4f8de18572754b
[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.0.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.0.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>0.0.1</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                                 <executions>
143                                         <execution>
144                                                 <id>Get features</id>
145                                                 <phase>generate-sources</phase>
146                                                 <goals>
147                                                         <goal>exec</goal>
148                                                 </goals>
149                                                 <configuration>
150                                                         <executable>/bin/bash</executable>
151                                                         <environmentVariables>
152                                                                 <APPC_VERSION>${appc.version}</APPC_VERSION>
153                                                                 <APPC_OAM_VERSION>${project.version}</APPC_OAM_VERSION>
154                                                                 <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION>
155                                                         </environmentVariables>
156                                                         <arguments>
157                                                                 <argument>${basedir}/src/main/scripts/installZips.sh</argument>
158                                                                 <argument>${basedir}/target/docker-stage/opt/openecomp/appc</argument>
159                                                         </arguments>
160                                                 </configuration>
161                                         </execution>
162
163                                         <execution>
164                                                 <id>change shell permissions</id>
165                                                 <phase>process-sources</phase>
166                                                 <goals>
167                                                         <goal>exec</goal>
168                                                 </goals>
169                                                 <configuration>
170                                                         <executable>/usr/bin/find</executable>
171                                                         <arguments>
172                                                                 <argument>${basedir}/target/docker-stage/opt/openecomp/appc</argument>
173                                                                 <argument>-name</argument>
174                                                                 <argument>*.sh</argument>
175                                                                 <argument>-exec</argument>
176                                                                 <argument>chmod</argument>
177                                                                 <argument>+x</argument>
178                                                                 <argument>{}</argument>
179                                                                 <argument>;</argument>
180                                                         </arguments>
181                                                 </configuration>
182                                         </execution>
183                                 </executions>
184                         </plugin>
185                 </plugins>
186         </build>
187
188         <profiles>
189                 <profile>
190                         <id>docker</id>
191                         <build>
192                                 <plugins>
193                                         <plugin>
194                                                 <groupId>io.fabric8</groupId>
195                                                 <artifactId>docker-maven-plugin</artifactId>
196                                                 <version>0.16.5</version>
197                                                 <inherited>false</inherited>
198                                                 <configuration>
199                                                         <images>
200                                                                 <image>
201                                                                         <name>${image.name}</name>
202                                                                         <build>
203                                                                                 <cleanup>try</cleanup>
204                                                                                 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
205                                                                                 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
206                                                                                 <tags>
207                                                                                         <tag>${appc.docker.staging.version}-STAGING-${maven.build.timestamp}</tag>
208                                                                                         <tag>latest</tag> 
209                                                                                 </tags>
210                                                                         </build>
211                                                                 </image>
212                                                         </images>
213                                                 </configuration>
214                                                 <executions>
215                                                         <execution>
216                                                                 <id>generate-images</id>
217                                                                 <phase>generate-sources</phase>
218                                                                 <goals>
219                                                                         <goal>build</goal>
220                                                                 </goals>
221                                                         </execution>
222
223                                                         <execution>
224                                                                 <id>push-images</id>
225                                                                 <phase>deploy</phase>
226                                                                 <goals>
227                                                                         <goal>build</goal>
228                                                                         <goal>push</goal>
229                                                                 </goals>
230                                                         </execution>
231                                                 </executions>
232                                         </plugin>
233
234                                         <!-- This is to add any extra scripts, sql dump files, properties files 
235                                                 APPC may need even after inheriting from the sdnc base image -->
236                                         <plugin>
237                                                 <artifactId>maven-resources-plugin</artifactId>
238                                                 <version>2.6</version>
239                                                 <executions>
240                                                         <execution>
241                                                                 <id>copy-dockerfile</id>
242                                                                 <goals>
243                                                                         <goal>copy-resources</goal>
244                                                                 </goals><!-- here the phase you need -->
245                                                                 <phase>validate</phase>
246                                                                 <configuration>
247                                                                         <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
248                                                                         <resources>
249                                                                                 <resource>
250                                                                                         <directory>src/main/docker</directory>
251                                                                                         <includes>
252                                                                                                 <include>Dockerfile</include>
253                                                                                         </includes>
254                                                                                         <filtering>true</filtering>
255                                                                                 </resource>
256                                                                         </resources>
257                                                                 </configuration>
258                                                         </execution>
259
260                                                         <execution>
261                                                                 <id>copy-scripts</id>
262                                                                 <goals>
263                                                                         <goal>copy-resources</goal>
264                                                                 </goals><!-- here the phase you need -->
265                                                                 <phase>validate</phase>
266                                                                 <configuration>
267                                                                         <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/appc/bin</outputDirectory>
268                                                                         <resources>
269                                                                                 <resource>
270                                                                                         <directory>src/main/scripts</directory>
271                                                                                         <includes>
272                                                                                                 <include>*.sh</include>
273                                                                                         </includes>
274                                                                                         <filtering>false</filtering>
275                                                                                 </resource>
276                                                                         </resources>
277                                                                 </configuration>
278                                                         </execution>
279
280                                                         <!-- Two commented execution tags below in case / when appc needs 
281                                                                 to add .dump mysql files or keystore files -->
282                                                         <!--<execution> <id>copy-data</id> <goals> <goal>copy-resources</goal> 
283                                                                 </goals> <phase>validate</phase> <configuration> <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/sdnc/data</outputDirectory> 
284                                                                 <resources> <resource> <directory>src/main/resources</directory> <includes> 
285                                                                 <include>*.dump</include> </includes> <filtering>false</filtering> </resource> 
286                                                                 </resources> </configuration> </execution> <execution> <id>copy-keystores</id> 
287                                                                 <goals> <goal>copy-resources</goal> </goals> <phase>validate</phase> <configuration> 
288                                                                 <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/sdnc/data/stores</outputDirectory> 
289                                                                 <resources> <resource> <directory>../src/main/stores</directory> <includes> 
290                                                                 <include>*.jks</include> </includes> <filtering>false</filtering> </resource> 
291                                                                 </resources> </configuration> </execution> -->
292
293                                                         <execution>
294                                                                 <id>copy-properties</id>
295                                                                 <goals>
296                                                                         <goal>copy-resources</goal>
297                                                                 </goals>
298                                                                 <phase>validate</phase>
299                                                                 <configuration>
300                                                                         <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/appc/data/properties</outputDirectory>
301                                                                         <resources>
302                                                                                 <resource>
303                                                                                         <directory>../src/main/appc-properties</directory>
304                                                                                         <includes>
305                                                                                                 <include>*.properties</include>
306                                                                                         </includes>
307                                                                                         <filtering>false</filtering>
308                                                                                 </resource>
309                                                                         </resources>
310                                                                 </configuration>
311                                                         </execution>
312                                                 </executions>
313                                         </plugin>
314                                         <plugin>
315                                                 <artifactId>exec-maven-plugin</artifactId>
316                                                 <groupId>org.codehaus.mojo</groupId>
317                                                 <executions>
318                                                         <execution>
319                                                                 <id>Get features</id>
320                                                                 <phase>generate-sources</phase>
321                                                                 <goals>
322                                                                         <goal>exec</goal>
323                                                                 </goals>
324                                                                 <configuration>
325                                                                         <executable>/bin/bash</executable>
326                                                                         <environmentVariables>
327                                                                                 <APPC_VERSION>${appc.version}</APPC_VERSION>
328                                                                                 <APPC_OAM_VERSION>${project.version}</APPC_OAM_VERSION>
329                                                                                 <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION>
330                                                                         </environmentVariables>
331                                                                         <arguments>
332                                                                                 <argument>${basedir}/src/main/scripts/installZips.sh</argument>
333                                                                                 <argument>${basedir}/target/docker-stage/opt/openecomp/appc</argument>
334                                                                         </arguments>
335                                                                 </configuration>
336                                                         </execution>
337
338                                                         <execution>
339                                                                 <id>change shell permissions</id>
340                                                                 <phase>process-sources</phase>
341                                                                 <goals>
342                                                                         <goal>exec</goal>
343                                                                 </goals>
344                                                                 <configuration>
345                                                                         <executable>/usr/bin/find</executable>
346                                                                         <arguments>
347                                                                                 <argument>${basedir}/target/docker-stage/opt/openecomp/appc</argument>
348                                                                                 <argument>-name</argument>
349                                                                                 <argument>*.sh</argument>
350                                                                                 <argument>-exec</argument>
351                                                                                 <argument>chmod</argument>
352                                                                                 <argument>+x</argument>
353                                                                                 <argument>{}</argument>
354                                                                                 <argument>;</argument>
355                                                                         </arguments>
356                                                                 </configuration>
357                                                         </execution>
358                                                 </executions>
359                                         </plugin>
360                                 </plugins>
361                         </build>
362
363                 </profile>
364         </profiles>
365         
366         <organization>
367                 <name>openECOMP</name>
368         </organization>
369         
370 </project>