Create base Sodium image
[ccsdk/distribution.git] / sliboot / 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.parent</groupId>
7         <artifactId>springboot/artifactId>
8         <version>2.0.0-SNAPSHOT</version>
9         <relativePath/>
10     </parent>
11
12     <groupId>org.onap.ccsdk.distribution</groupId>
13     <artifactId>distribution-sliboot</artifactId>
14     <version>1.0.0-SNAPSHOT</version>
15     <packaging>pom</packaging>
16
17     <name>ccsdk-distribution :: sliboot</name>
18     <description>Creates Springboot-based Docker container</description>
19     <organization>
20         <name>ONAP</name>
21     </organization>
22
23     <properties>
24         <base.image.name>onap/ccsdk-alpine-image</base.image.name>
25         <image.name>onap/ccsdk-sliboot-alpine-image</image.name>
26         <ccsdk.project.version>${project.version}</ccsdk.project.version>
27         <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
28         <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
29         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
30         <docker.push.phase>deploy</docker.push.phase>
31         <docker.verbose>true</docker.verbose>
32
33         <ccsdk.features.version>1.0.0-SNAPSHOT</ccsdk.features.version>
34         <ccsdk.sli.core.version>1.0.0-SNAPSHOT</ccsdk.sli.core.version>
35         <ccsdk.sli.adaptors.version>1.0.0-SNAPSHOT</ccsdk.sli.adaptors.version>
36         <ccsdk.sli.northbound.version>1.0.0-SNAPSHOT</ccsdk.sli.northbound.version>
37         <ccsdk.sli.plugins.version>1.0.0-SNAPSHOT</ccsdk.sli.plugins.version>
38     </properties>
39
40     <dependencies>
41         <dependency>
42             <groupId>org.onap.ccsdk.sli.core</groupId>
43             <artifactId>sliapi-springboot</artifactId>
44             <version>${ccsdk.sli.core.version}</version>
45         </dependency>
46         <dependency>
47             <groupId>org.onap.ccsdk.sli.core</groupId>
48             <artifactId>filters-installer</artifactId>
49             <version>${ccsdk.sli.core.version}</version>
50             <classifier>repo</classifier>
51             <type>zip</type>
52         </dependency>
53         <dependency>
54             <groupId>org.onap.ccsdk.sli.core</groupId>
55             <artifactId>sli-installer</artifactId>
56             <version>${ccsdk.sli.core.version}</version>
57             <classifier>repo</classifier>
58             <type>zip</type>
59         </dependency>
60     </dependencies>
61
62     <build>
63         <extensions>
64             <extension>
65                 <!-- this extension is required by wagon in order to pass the proxy -->
66                 <groupId>org.apache.maven.wagon</groupId>
67                 <artifactId>wagon-http-lightweight</artifactId>
68                 <version>2.2</version>
69             </extension>
70         </extensions>
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}/../../src/main/scripts/TagVersion.groovy</source>
85                         </configuration>
86                     </execution>
87                 </executions>
88             </plugin>
89
90
91             <plugin>
92                 <artifactId>maven-resources-plugin</artifactId>
93                 <version>2.6</version>
94                 <executions>
95                     <execution>
96                         <id>copy-dockerfile</id>
97                         <goals>
98                             <goal>copy-resources</goal>
99                         </goals><!-- here the phase you need -->
100                         <phase>validate</phase>
101                         <configuration>
102                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
103                             <resources>
104                                 <resource>
105                                     <directory>src/main/docker</directory>
106                                     <includes>
107                                         <include>Dockerfile</include>
108                                     </includes>
109                                     <filtering>true</filtering>
110                                 </resource>
111                             </resources>
112                         </configuration>
113                     </execution>
114
115                     <execution>
116                         <id>copy-scripts</id>
117                         <goals>
118                             <goal>copy-resources</goal>
119                         </goals><!-- here the phase you need -->
120                         <phase>validate</phase>
121                         <configuration>
122                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/bin</outputDirectory>
123                             <resources>
124                                 <resource>
125                                     <directory>../src/main/scripts</directory>
126                                     <includes>
127                                         <include>*.sh</include>
128                                     </includes>
129                                     <filtering>false</filtering>
130                                 </resource>
131                             </resources>
132                         </configuration>
133                     </execution>
134
135                     <execution>
136                         <id>copy-odl-resources</id>
137                         <goals>
138                             <goal>copy-resources</goal>
139                         </goals><!-- here the phase you need -->
140                         <phase>validate</phase>
141                         <configuration>
142                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
143                             <resources>
144                                 <resource>
145                                     <directory>../src/main/resources</directory>
146                                     <includes>
147                                         <include>idmlight.db.mv.db</include>
148                                         <include>org.ops4j.pax.logging.cfg</include>
149                                         <include>install_ccsdk.yml</include>
150                                         <include>ansible-sources.list</include>
151                                     </includes>
152                                     <filtering>false</filtering>
153                                 </resource>
154                             </resources>
155                         </configuration>
156                     </execution>
157                     <execution>
158                         <id>copy-config</id>
159                         <goals>
160                             <goal>copy-resources</goal>
161                         </goals><!-- here the phase you need -->
162                         <phase>validate</phase>
163                         <configuration>
164                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
165                             <resources>
166                                 <resource>
167                                     <directory>../src/main/resources</directory>
168                                     <includes>
169                                         <include>org.ops4j.pax.logging.cfg</include>
170                                     </includes>
171                                     <filtering>false</filtering>
172                                 </resource>
173                             </resources>
174                         </configuration>
175                     </execution>
176                     <execution>
177                         <id>copy-data</id>
178                         <goals>
179                             <goal>copy-resources</goal>
180                         </goals><!-- here the phase you need -->
181                         <phase>validate</phase>
182                         <configuration>
183                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/data</outputDirectory>
184                             <resources>
185                                 <resource>
186                                     <directory>../src/main/resources</directory>
187                                     <includes>
188                                         <include>*.dump</include>
189                                     </includes>
190                                     <filtering>false</filtering>
191                                 </resource>
192                             </resources>
193                         </configuration>
194                     </execution>
195                     <execution>
196                         <id>copy-properties</id>
197                         <goals>
198                             <goal>copy-resources</goal>
199                         </goals><!-- here the phase you need -->
200                         <phase>validate</phase>
201                         <configuration>
202                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/data/properties
203                             </outputDirectory>
204                             <resources>
205                                 <resource>
206                                     <directory>../src/main/properties</directory>
207                                     <includes>
208                                         <include>*.properties</include>
209                                         <include>*.vt</include>
210                                     </includes>
211                                     <filtering>false</filtering>
212                                 </resource>
213                             </resources>
214                         </configuration>
215                     </execution>
216                     <execution>
217                         <id>copy-keystores</id>
218                         <goals>
219                             <goal>copy-resources</goal>
220                         </goals><!-- here the phase you need -->
221                         <phase>validate</phase>
222                         <configuration>
223                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/data/stores</outputDirectory>
224                             <resources>
225                                 <resource>
226                                     <directory>../src/main/stores</directory>
227                                     <includes>
228                                         <include>*.jks</include>
229                                     </includes>
230                                     <filtering>false</filtering>
231                                 </resource>
232                             </resources>
233                         </configuration>
234                     </execution>
235                 </executions>
236             </plugin>
237             <plugin>
238                 <groupId>org.apache.maven.plugins</groupId>
239                 <artifactId>maven-dependency-plugin</artifactId>
240                 <version>3.0.2</version>
241                 <executions>
242                     <execution>
243                         <id>unpack features</id>
244                         <phase>generate-sources</phase>
245                         <goals>
246                             <goal>unpack-dependencies</goal>
247                         </goals>
248                         <configuration>
249                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
250                             <excludeTransitive>true</excludeTransitive>
251                         </configuration>
252                     </execution>
253                     <execution>
254                         <id>unpack dgs</id>
255                         <phase>generate-sources</phase>
256                         <goals>
257                             <goal>unpack</goal>
258                         </goals>
259                         <configuration>
260                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk</outputDirectory>
261                             <artifactItems>
262                                 <artifactItem>
263                                     <groupId>${project.groupId}</groupId>
264                                     <artifactId>platform-logic-installer</artifactId>
265                                     <version>${project.version}</version>
266                                     <type>zip</type>
267                                 </artifactItem>
268                             </artifactItems>
269                         </configuration>
270                     </execution>
271                 </executions>
272             </plugin>
273             <plugin>
274                 <groupId>org.codehaus.mojo</groupId>
275                 <artifactId>exec-maven-plugin</artifactId>
276                 <version>1.5.0</version>
277                 <executions>
278
279                     <execution>
280                         <id>change shell permissions</id>
281                         <phase>process-sources</phase>
282                         <goals>
283                             <goal>exec</goal>
284                         </goals>
285                         <configuration>
286                             <executable>/usr/bin/find</executable>
287                             <arguments>
288                                 <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
289                                 <argument>-name</argument>
290                                 <argument>*.sh</argument>
291                                 <argument>-exec</argument>
292                                 <argument>chmod</argument>
293                                 <argument>+x</argument>
294                                 <argument>{}</argument>
295                                 <argument>;</argument>
296                             </arguments>
297                         </configuration>
298                     </execution>
299                 </executions>
300             </plugin>
301
302
303         </plugins>
304     </build>
305
306     <profiles>
307         <profile>
308             <id>docker</id>
309             <build>
310                 <plugins>
311                     <plugin>
312                         <groupId>io.fabric8</groupId>
313                         <artifactId>docker-maven-plugin</artifactId>
314                         <version>0.28.0</version>
315                         <inherited>false</inherited>
316                         <configuration>
317                             <images>
318                                 <image>
319                                     <name>${image.name}</name>
320                                     <build>
321                                         <cleanup>try</cleanup>
322                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
323                                         <dockerFile>Dockerfile</dockerFile>
324                                         <tags>
325                                             <tag>${project.docker.latestminortag.version}</tag>
326                                             <tag>${project.docker.latestfulltag.version}</tag>
327                                             <tag>${project.docker.latesttagtimestamp.version}</tag>
328                                         </tags>
329                                     </build>
330                                 </image>
331                             </images>
332                         </configuration>
333                         <executions>
334                             <execution>
335                                 <id>generate-images</id>
336                                 <phase>package</phase>
337                                 <goals>
338                                     <goal>build</goal>
339                                 </goals>
340                             </execution>
341
342                             <execution>
343                                 <id>push-images</id>
344                                 <phase>${docker.push.phase}</phase>
345                                 <goals>
346                                     <goal>build</goal>
347                                     <goal>push</goal>
348                                 </goals>
349                             </execution>
350                         </executions>
351                     </plugin>
352                 </plugins>
353             </build>
354         </profile>
355     </profiles>
356 </project>