5cc35d6567f60c6d20e6ab0abd909ec28e9f4815
[sdnc/oam.git] / installation / sdnc / 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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3     <modelVersion>4.0.0</modelVersion>
4
5     <parent>
6         <groupId>org.onap.sdnc.oam</groupId>
7         <artifactId>installation</artifactId>
8         <version>2.1.1-SNAPSHOT</version>
9     </parent>
10
11     <groupId>org.onap.sdnc.oam</groupId>
12     <artifactId>installation-sdnc</artifactId>
13     <version>2.1.1-SNAPSHOT</version>
14     <packaging>pom</packaging>
15
16     <name>sdnc-oam :: installation :: ${project.artifactId}</name>
17     <description>Creates SDN Controller Docker container</description>
18     <organization>
19         <name>ONAP</name>
20     </organization>
21
22     <properties>
23         <image.name>onap/sdnc-aaf-image</image.name>
24         <standalone.image.name>onap/sdnc-image</standalone.image.name>
25         <sdnc.project.version>${project.version}</sdnc.project.version>
26         <sdnc.build.timestamp>${maven.build.timestamp}</sdnc.build.timestamp>
27         <sdnc.northbound.version>2.1.1-SNAPSHOT</sdnc.northbound.version>
28         <ccsdk.docker.version>1.1.1-SNAPSHOT-latest</ccsdk.docker.version>
29         <sdnc.keystore>org.onap.sdnc.p12</sdnc.keystore>
30         <sdnc.keypass><![CDATA[;:G58,7ZhqOSI:7^oZCY[9Dv]]></sdnc.keypass>
31         <sdnc.secureport>8443</sdnc.secureport>
32         <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
33         <docker.push.phase>deploy</docker.push.phase>
34         <docker.verbose>true</docker.verbose> 
35         <docker.autoCreateCustomNetworks>true</docker.autoCreateCustomNetworks>
36         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
37     </properties>
38
39     <dependencies>
40         <dependency>
41             <groupId>org.onap.sdnc.northbound</groupId>
42             <artifactId>generic-resource-api-installer</artifactId>
43             <version>${sdnc.northbound.version}</version>
44             <type>zip</type>
45             <classifier>repo</classifier>
46         </dependency>
47        <dependency>
48             <groupId>org.onap.sdnc.northbound</groupId>
49             <artifactId>optical-service-installer</artifactId>
50             <version>${sdnc.northbound.version}</version>
51             <type>zip</type>
52             <classifier>repo</classifier>
53         </dependency>
54         <dependency>
55             <groupId>org.onap.sdnc.northbound</groupId>
56             <artifactId>vnftools-installer</artifactId>
57             <version>${sdnc.northbound.version}</version>
58             <type>zip</type>
59             <classifier>repo</classifier>
60         </dependency>
61         <dependency>
62             <groupId>org.onap.sdnc.northbound</groupId>
63             <artifactId>sdnc-northbound-features-installer</artifactId>
64             <version>${sdnc.northbound.version}</version>
65             <type>zip</type>
66             <classifier>repo</classifier>
67         </dependency>
68     </dependencies>
69
70     <build>
71         <plugins>
72
73
74             <plugin>
75                 <groupId>org.codehaus.groovy.maven</groupId>
76                 <artifactId>gmaven-plugin</artifactId>
77                 <executions>
78                     <execution>
79                         <phase>validate</phase>
80                         <goals>
81                             <goal>execute</goal>
82                         </goals>
83                         <configuration>
84                             <source>${basedir}/../TagVersion.groovy</source>
85                         </configuration>
86                     </execution>
87                 </executions>
88             </plugin>
89
90             <plugin>
91                 <groupId>io.fabric8</groupId>
92                 <artifactId>docker-maven-plugin</artifactId>
93                 <version>0.28.0</version>
94                 <inherited>false</inherited>
95                 <executions>
96                     <execution>
97                         <id>generate-images</id>
98                         <phase>package</phase>
99                         <goals>
100                             <goal>build</goal>
101                         </goals>
102                         <configuration>
103                            <images>
104                             <image>
105                              <name>${image.name}</name>
106                              <build>
107                               <cleanup>try</cleanup>
108                               <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
109                               <dockerFile>Dockerfile</dockerFile>
110                               <tags>
111                                  <tag>${project.docker.latestminortag.version}</tag>
112                                  <tag>${project.docker.latestfulltag.version}</tag>
113                                  <tag>${project.docker.latesttagtimestamp.version}</tag>
114                               </tags>
115                              </build>
116                             </image>
117                            </images>
118                           </configuration>
119                     </execution>
120                     <execution>
121                         <id>start-it-instance</id>
122                         <phase>pre-integration-test</phase>
123                         <goals>
124                             <goal>start</goal>
125                         </goals>
126                         <configuration>
127                             <images>
128                                 <image>
129                                     <name>mariadb:10.5</name>
130                                     <alias>sdnc-db</alias>
131                                     <run>
132                                         <env>
133                                             <MYSQL_ROOT_PASSWORD>itsASecret</MYSQL_ROOT_PASSWORD>
134                                             <MYSQL_USER>sdnctl</MYSQL_USER>
135                                             <MYSQL_PASSWORD>gamma</MYSQL_PASSWORD>
136                                             <MYSQL_DATABASE>sdnctl</MYSQL_DATABASE>
137                                         </env>
138                                         <network>
139                                             <mode>custom</mode>
140                                             <name>sdnc</name>
141                                             <alias>dbhost</alias>
142                                             <alias>sdnctldb01</alias>
143                                             <alias>sdnctldb02</alias>
144                                         </network>
145                                         <ports>
146                                             <port>sdncdb.port:3306</port>
147                                         </ports>
148                                         <log>
149                                             <enabled>true</enabled>
150                                         </log>
151                                     </run>
152                                 </image>
153                                 <image>
154                                     <name>${image.name}:${project.docker.latesttagtimestamp.version}</name>
155                                     <alias>sdnc-container</alias>
156                                     <run>
157                                         <env>
158                                             <ODL_PASSWORD>admin</ODL_PASSWORD>
159                                             <MYSQL_ROOT_PASSWORD>itsASecret</MYSQL_ROOT_PASSWORD>
160                                             <MYSQL_USER>sdnctl</MYSQL_USER>
161                                             <MYSQL_PASSWORD>gamma</MYSQL_PASSWORD>
162                                             <MYSQL_DATABASE>sdnctl</MYSQL_DATABASE>
163                                             <SDNC_CONFIG_DIR>/opt/onap/sdnc/data/properties</SDNC_CONFIG_DIR>
164                                             <KARAF_CONSOLE_LOG_LEVEL>INFO</KARAF_CONSOLE_LOG_LEVEL>
165                                         </env>
166                                         <dependsOn>
167                                             <container>sdnc-db</container>
168                                         </dependsOn>
169                                         <network>
170                                             <mode>custom</mode>
171                                             <name>sdnc</name>
172                                             <alias>sdnc</alias>
173                                         </network>&gt;
174                                         <ports>
175                                             <port>sdnc.port:8181</port>
176                                         </ports>
177                                         <wait>
178                                             <log>all warp coils are now operating at peak efficiency</log>
179                                             <time>120000</time>
180                                         </wait>
181                                         <log>
182                                             <enabled>true</enabled>
183                                         </log>
184                                     </run>
185                                 </image>
186                             </images>
187                         </configuration>
188                     </execution>
189                     <execution>
190                         <id>stop-it-instance</id>
191                         <phase>post-integration-test</phase>
192                         <goals>
193                             <goal>stop</goal>
194                         </goals>
195                     </execution>
196                     <execution>
197                       <id>push-images</id>
198                       <phase>${docker.push.phase}</phase>
199                       <goals>
200                        <goal>build</goal>
201                        <goal>push</goal>
202                       </goals>
203                        <configuration>
204                         <images>
205                          <image>
206                           <name>${image.name}</name>
207                           <build>
208                            <cleanup>try</cleanup>
209                            <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
210                            <dockerFile>Dockerfile</dockerFile>
211                            <tags>
212                               <tag>${project.docker.latestminortag.version}</tag>
213                               <tag>${project.docker.latestfulltag.version}</tag>
214                               <tag>${project.docker.latesttagtimestamp.version}</tag>
215                            </tags>
216                           </build>
217                          </image>
218                         </images>
219                        </configuration>
220                    </execution>
221                    <execution>
222                      <id>generate-standalone-images</id>
223                      <phase>package</phase>
224                      <goals>
225                       <goal>build</goal>
226                      </goals>
227                      <configuration>
228                       <images>
229                        <image>
230                         <name>${standalone.image.name}</name>
231                         <build>
232                          <cleanup>try</cleanup>
233                          <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
234                          <dockerFile>standalone.Dockerfile</dockerFile>
235                          <tags>
236                              <tag>${project.docker.latestminortag.version}</tag>
237                              <tag>${project.docker.latestfulltag.version}</tag>
238                              <tag>${project.docker.latesttagtimestamp.version}</tag>
239                          </tags>
240                         </build>
241                        </image>
242                       </images>
243                      </configuration>
244                    </execution>
245                    <execution>
246                      <id>push-standalone-images</id>
247                      <phase>${docker.push.phase}</phase>
248                      <goals>
249                       <goal>build</goal>
250                       <goal>push</goal>
251                      </goals>
252                      <configuration>
253                        <images>
254                         <image>
255                          <name>${standalone.image.name}</name>
256                          <build>
257                           <cleanup>try</cleanup>
258                           <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
259                           <dockerFile>standalone.Dockerfile</dockerFile>
260                           <tags>
261                              <tag>${project.docker.latestminortag.version}</tag>
262                              <tag>${project.docker.latestfulltag.version}</tag>
263                              <tag>${project.docker.latesttagtimestamp.version}</tag>
264                           </tags>
265                          </build>
266                         </image>
267                        </images>
268                      </configuration>
269                   </execution>
270                 </executions>
271             </plugin>
272             <plugin>
273                 <artifactId>maven-resources-plugin</artifactId>
274                 <version>2.6</version>
275                 <executions>
276                     <execution>
277                         <id>copy-dockerfile</id>
278                         <goals>
279                             <goal>copy-resources</goal>
280                         </goals><!-- here the phase you need -->
281                         <phase>validate</phase>
282                         <configuration>
283                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
284                             <resources>
285                                 <resource>
286                                     <directory>src/main/docker</directory>
287                                     <includes>
288                                         <include>Dockerfile</include>
289                                         <include>standalone.Dockerfile</include>
290                                     </includes>
291                                     <filtering>true</filtering>
292                                 </resource>
293                             </resources>
294                         </configuration>
295                     </execution>
296                     <execution>
297                         <id>copy-scripts</id>
298                         <goals>
299                             <goal>copy-resources</goal>
300                         </goals><!-- here the phase you need -->
301                         <phase>validate</phase>
302                         <configuration>
303                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/bin</outputDirectory>
304                             <resources>
305                                 <resource>
306                                     <directory>src/main/scripts</directory>
307                                     <includes>
308                                         <include>*.py</include>
309                                         <include>*.sh</include>
310                                     </includes>
311                                     <filtering>false</filtering>
312                                 </resource>
313                             </resources>
314                         </configuration>
315                     </execution>
316                     <execution>
317                         <id>copy-tarballs</id>
318                         <goals>
319                             <goal>copy-resources</goal>
320                         </goals><!-- here the phase you need -->
321                         <phase>validate</phase>
322                         <configuration>
323                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
324                             <resources>
325                                 <resource>
326                                     <directory>src/main/resources</directory>
327                                     <includes>
328                                         <include>idmlight.db.mv.db</include>
329                                         <include>truststoreONAPall.jks</include>
330                                         <include>aaa-app-config.xml</include>
331                                     </includes>
332                                     <filtering>false</filtering>
333                                 </resource>
334                             </resources>
335                         </configuration>
336                     </execution>
337                     <execution>
338                         <id>copy-data</id>
339                         <goals>
340                             <goal>copy-resources</goal>
341                         </goals><!-- here the phase you need -->
342                         <phase>validate</phase>
343                         <configuration>
344                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data</outputDirectory>
345                             <resources>
346                                 <resource>
347                                     <directory>src/main/resources</directory>
348                                     <includes>
349                                         <include>*.dump</include>
350                                         <include>oauth-aaa-app-config.xml</include>
351                                     </includes>
352                                     <filtering>false</filtering>
353                                 </resource>
354                             </resources>
355                         </configuration>
356                     </execution>
357                     <execution>
358                         <id>copy-properties</id>
359                         <goals>
360                             <goal>copy-resources</goal>
361                         </goals><!-- here the phase you need -->
362                         <phase>validate</phase>
363                         <configuration>
364                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</outputDirectory>
365                             <resources>
366                                 <resource>
367                                     <directory>../src/main/properties</directory>
368                                     <includes>
369                                         <include>*.properties</include>
370                                         <include>*.props</include>
371                                         <include>*.csv</include>
372                                     </includes>
373                                     <filtering>false</filtering>
374                                 </resource>
375                             </resources>
376                         </configuration>
377                     </execution>
378                     <execution>
379                         <id>copy-keystores</id>
380                         <goals>
381                             <goal>copy-resources</goal>
382                         </goals><!-- here the phase you need -->
383                         <phase>validate</phase>
384                         <configuration>
385                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/stores</outputDirectory>
386                             <resources>
387                                 <resource>
388                                     <directory>../src/main/stores</directory>
389                                     <includes>
390                                         <include>*.jks</include>
391                                         <include>*.keyfile</include>
392                                         <include>*.p12</include>
393                                     </includes>
394                                     <filtering>false</filtering>
395                                 </resource>
396                             </resources>
397                         </configuration>
398                     </execution>
399                 </executions>
400             </plugin>
401             <plugin>
402                 <groupId>org.apache.maven.plugins</groupId>
403                 <artifactId>maven-dependency-plugin</artifactId>
404                 <version>3.0.2</version>
405                 <executions>
406                     <execution>
407                         <id>unpack sdnc features</id>
408                         <phase>generate-sources</phase>
409                         <goals>
410                             <goal>unpack-dependencies</goal>
411                         </goals>
412                         <configuration>
413                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
414                             <excludeTransitive>true</excludeTransitive>
415                         </configuration>
416                     </execution>
417                     <execution>
418                         <id>unpack dgs</id>
419                         <phase>generate-sources</phase>
420                         <goals>
421                             <goal>unpack</goal>
422                         </goals>
423                         <configuration>
424                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc</outputDirectory>
425                             <artifactItems>
426                                 <artifactItem>
427                                     <groupId>${project.groupId}</groupId>
428                                     <artifactId>platform-logic-installer</artifactId>
429                                     <version>${project.version}</version>
430                                     <type>zip</type>
431                                 </artifactItem>
432                             </artifactItems>
433                         </configuration>
434                     </execution>
435                     <execution>
436                         <id>unpack migration utility</id>
437                         <phase>generate-sources</phase>
438                         <goals>
439                             <goal>unpack</goal>
440                         </goals>
441                         <configuration>
442                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data-migrator</outputDirectory>
443                             <artifactItems>
444                                 <artifactItem>
445                                     <groupId>org.onap.sdnc.oam</groupId>
446                                     <artifactId>data-migrator</artifactId>
447                                     <version>${project.version}</version>
448                                     <type>zip</type>
449                                 </artifactItem>
450                             </artifactItems>
451                         </configuration>
452                     </execution>
453                 </executions>
454             </plugin>
455             <plugin>
456                 <groupId>org.codehaus.mojo</groupId>
457                 <artifactId>exec-maven-plugin</artifactId>
458                 <version>1.5.0</version>
459                 <executions>
460                     <execution>
461                         <id>change shell permissions</id>
462                         <phase>process-sources</phase>
463                         <goals>
464                             <goal>exec</goal>
465                         </goals>
466                         <configuration>
467                             <executable>/usr/bin/find</executable>
468                             <arguments>
469                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
470                                 <argument>-name</argument>
471                                 <argument>*.sh</argument>
472                                 <argument>-exec</argument>
473                                 <argument>chmod</argument>
474                                 <argument>+x</argument>
475                                 <argument>{}</argument>
476                                 <argument>;</argument>
477                             </arguments>
478                         </configuration>
479                     </execution>
480                 </executions>
481             </plugin>
482             <plugin>
483                 <groupId>org.apache.maven.plugins</groupId>
484                 <artifactId>maven-failsafe-plugin</artifactId>
485                 <executions>
486                   <execution>
487                     <goals>
488                       <goal>integration-test</goal>
489                       <goal>verify</goal>
490                     </goals>
491                   </execution>
492                 </executions>
493                 <configuration>
494                   <skipITs>false</skipITs>
495                   <environmentVariables>
496                     <SDNC_PORT>${sdnc.port}</SDNC_PORT>
497                   </environmentVariables>
498                 </configuration>
499               </plugin>
500         </plugins>
501     </build>
502 </project>