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