68865e9baac60d8afdbb252bf0c3b6f77c5eec53
[ccsdk/distribution.git] / odlsli / 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.ccsdk.distribution</groupId>
7         <artifactId>distribution-root</artifactId>
8         <version>0.2.1-SNAPSHOT</version>
9     </parent>
10
11     <artifactId>distribution-odlsli</artifactId>
12     <version>0.2.1-SNAPSHOT</version>
13     <packaging>pom</packaging>
14
15     <name>ccsdk-distribution :: odlsli</name>
16     <description>Creates SDN Controller Docker container</description>
17     <organization>
18         <name>openECOMP</name>
19     </organization>
20
21     <properties>
22         <image.name>onap/ccsdk-odlsli-image</image.name>
23         <ccsdk.project.version>${project.version}</ccsdk.project.version>
24         <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
25     </properties>
26
27     <build>
28         <plugins>
29
30
31             <plugin>
32                 <groupId>org.codehaus.groovy.maven</groupId>
33                 <artifactId>gmaven-plugin</artifactId>
34                 <executions>
35                     <execution>
36                         <phase>validate</phase>
37                         <goals>
38                             <goal>execute</goal>
39                         </goals>
40                         <configuration>
41                             <source>
42                                 println project.properties['ccsdk.project.version'];
43                                 def versionArray;
44                                 if ( project.properties['ccsdk.project.version'] != null ) {
45                                     versionArray = project.properties['ccsdk.project.version'].split('\\.');
46                                 }
47
48                                 if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
49                                 {
50                                     project.properties['project.docker.latesttag.version']=versionArray[0]  + '.' + versionArray[1] + "-STAGING-latest";
51                                 } else {
52                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
53                                 }
54
55                                 println 'New Tag for docker:' +
56                                 project.properties['project.docker.latesttag.version'];
57                             </source>
58                         </configuration>
59                     </execution>
60                 </executions>
61             </plugin>
62
63
64
65             <plugin>
66                 <artifactId>maven-resources-plugin</artifactId>
67                 <version>2.6</version>
68                 <executions>
69                     <execution>
70                         <id>copy-dockerfile</id>
71                         <goals>
72                             <goal>copy-resources</goal>
73                         </goals><!-- here the phase you need -->
74                         <phase>validate</phase>
75                         <configuration>
76                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
77                             <resources>
78                                 <resource>
79                                     <directory>src/main/docker</directory>
80                                     <includes>
81                                         <include>Dockerfile</include>
82                                     </includes>
83                                     <filtering>true</filtering>
84                                 </resource>
85                             </resources>
86                         </configuration>
87                     </execution>
88
89                     <execution>
90                         <id>copy-scripts</id>
91                         <goals>
92                             <goal>copy-resources</goal>
93                         </goals><!-- here the phase you need -->
94                         <phase>validate</phase>
95                         <configuration>
96                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/bin</outputDirectory>
97                             <resources>
98                                 <resource>
99                                     <directory>src/main/scripts</directory>
100                                     <includes>
101                                         <include>*.sh</include>
102                                     </includes>
103                                     <filtering>false</filtering>
104                                 </resource>
105                             </resources>
106                         </configuration>
107                     </execution>
108
109                     <execution>
110                         <id>copy-tarballs</id>
111                         <goals>
112                             <goal>copy-resources</goal>
113                         </goals><!-- here the phase you need -->
114                         <phase>validate</phase>
115                         <configuration>
116                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
117                             <resources>
118                                 <resource>
119                                     <directory>src/main/resources</directory>
120                                     <includes>
121                                         <include>idmlight.db.mv.db</include>
122                                     </includes>
123                                     <filtering>false</filtering>
124                                 </resource>
125                             </resources>
126                         </configuration>
127                     </execution>
128                     <execution>
129                         <id>copy-config</id>
130                         <goals>
131                             <goal>copy-resources</goal>
132                         </goals><!-- here the phase you need -->
133                         <phase>validate</phase>
134                         <configuration>
135                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
136                             <resources>
137                                 <resource>
138                                     <directory>src/main/resources</directory>
139                                     <includes>
140                                         <include>org.ops4j.pax.logging.cfg</include>
141                                     </includes>
142                                     <filtering>false</filtering>
143                                 </resource>
144                             </resources>
145                         </configuration>
146                     </execution>
147                     <execution>
148                         <id>copy-data</id>
149                         <goals>
150                             <goal>copy-resources</goal>
151                         </goals><!-- here the phase you need -->
152                         <phase>validate</phase>
153                         <configuration>
154                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data</outputDirectory>
155                             <resources>
156                                 <resource>
157                                     <directory>src/main/resources</directory>
158                                     <includes>
159                                         <include>*.dump</include>
160                                     </includes>
161                                     <filtering>false</filtering>
162                                 </resource>
163                             </resources>
164                         </configuration>
165                     </execution>
166                     <execution>
167                         <id>copy-properties</id>
168                         <goals>
169                             <goal>copy-resources</goal>
170                         </goals><!-- here the phase you need -->
171                         <phase>validate</phase>
172                         <configuration>
173                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</outputDirectory>
174                             <resources>
175                                 <resource>
176                                     <directory>src/main/properties</directory>
177                                     <includes>
178                                         <include>*.properties</include>
179                                     </includes>
180                                     <filtering>false</filtering>
181                                 </resource>
182                             </resources>
183                         </configuration>
184                     </execution>
185                     <execution>
186                         <id>copy-keystores</id>
187                         <goals>
188                             <goal>copy-resources</goal>
189                         </goals><!-- here the phase you need -->
190                         <phase>validate</phase>
191                         <configuration>
192                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/stores</outputDirectory>
193                             <resources>
194                                 <resource>
195                                     <directory>src/main/stores</directory>
196                                     <includes>
197                                         <include>*.jks</include>
198                                     </includes>
199                                     <filtering>false</filtering>
200                                 </resource>
201                             </resources>
202                         </configuration>
203                     </execution>
204                 </executions>
205             </plugin>
206             <plugin>
207                 <groupId>org.codehaus.mojo</groupId>
208                 <artifactId>exec-maven-plugin</artifactId>
209                 <version>1.5.0</version>
210                 <executions>
211
212                     <execution>
213                         <id>Get features</id>
214                         <phase>generate-sources</phase>
215                         <goals>
216                             <goal>exec</goal>
217                         </goals>
218                         <configuration>
219                             <executable>/bin/bash</executable>
220                             <environmentVariables>
221                                 <SDNC_CORE_VERSION>${ccsdk.sli.core.version}</SDNC_CORE_VERSION>
222                                 <SDNC_ADAPTORS_VERSION>${ccsdk.sli.adaptors.version}</SDNC_ADAPTORS_VERSION>
223                                 <SDNC_NORTHBOUND_VERSION>${ccsdk.sli.northbound.version}</SDNC_NORTHBOUND_VERSION>
224                                 <SDNC_PLUGINS_VERSION>${ccsdk.sli.plugins.version}</SDNC_PLUGINS_VERSION>
225                                 <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION>
226                             </environmentVariables>
227                             <arguments>
228                                 <argument>${basedir}/src/main/scripts/installZips.sh</argument>
229                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
230                             </arguments>
231                         </configuration>
232                     </execution>
233
234                     <execution>
235                         <id>change shell permissions</id>
236                         <phase>process-sources</phase>
237                         <goals>
238                             <goal>exec</goal>
239                         </goals>
240                         <configuration>
241                             <executable>/usr/bin/find</executable>
242                             <arguments>
243                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
244                                 <argument>-name</argument>
245                                 <argument>*.sh</argument>
246                                 <argument>-exec</argument>
247                                 <argument>chmod</argument>
248                                 <argument>+x</argument>
249                                 <argument>{}</argument>
250                                 <argument>;</argument>
251                             </arguments>
252                         </configuration>
253                     </execution>
254                 </executions>
255             </plugin>
256
257
258         </plugins>
259     </build>
260
261     <profiles>
262         <profile>
263             <id>docker</id>
264             <build>
265                 <plugins>
266                     <plugin>
267                         <groupId>io.fabric8</groupId>
268                         <artifactId>docker-maven-plugin</artifactId>
269                         <version>0.16.5</version>
270                         <inherited>false</inherited>
271                         <configuration>
272                             <images>
273                                 <image>
274                                     <name>${image.name}</name>
275                                     <build>
276                                         <cleanup>try</cleanup>
277                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
278                                         <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
279                                         <tags>
280                                             <tag>${project.version}</tag>
281                                             <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
282                                             <tag>${project.docker.latesttag.version}</tag>
283                                         </tags>
284                                     </build>
285                                 </image>
286                             </images>
287                         </configuration>
288                         <executions>
289                             <execution>
290                                 <id>generate-images</id>
291                                 <phase>package</phase>
292                                 <goals>
293                                     <goal>build</goal>
294                                 </goals>
295                             </execution>
296
297                             <execution>
298                                 <id>push-images</id>
299                                 <phase>deploy</phase>
300                                 <goals>
301                                     <goal>build</goal>
302                                     <goal>push</goal>
303                                 </goals>
304                             </execution>
305                         </executions>
306                     </plugin>
307                 </plugins>
308             </build>
309         </profile>
310     </profiles>
311 </project>