Fix CCSDK docker version
[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"
3         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5
6         <parent>
7                 <groupId>org.onap.ccsdk.parent</groupId>
8                 <artifactId>odlparent-lite</artifactId>
9                 <version>1.1.2-SNAPSHOT</version>
10         </parent>
11
12         <modelVersion>4.0.0</modelVersion>
13         <packaging>pom</packaging>
14         <groupId>org.onap.sdnc.oam</groupId>
15         <artifactId>installation-sdnc</artifactId>
16         <version>1.4.2-SNAPSHOT</version>
17
18         <name>sdnc-oam :: installation :: ${project.artifactId}</name>
19         <description>Creates SDN Controller Docker container</description>
20
21         <properties>
22                 <image.name>onap/sdnc-image</image.name>
23                 <sdnc.project.version>${project.version}</sdnc.project.version>
24                 <sdnc.northbound.version>1.4.2-SNAPSHOT</sdnc.northbound.version>
25                 <ccsdk.docker.version>0.3-STAGING-latest</ccsdk.docker.version>
26                 <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
27                 <docker.push.phase>deploy</docker.push.phase>
28                 <docker.verbose>true</docker.verbose>
29                 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
30         </properties>
31
32         <dependencies>
33                 <dependency>
34                         <groupId>org.onap.sdnc.northbound</groupId>
35                         <artifactId>generic-resource-api-installer</artifactId>
36                         <version>${sdnc.northbound.version}</version>
37                         <classifier>repo</classifier>
38                         <type>zip</type>
39                 </dependency>
40                 <dependency>
41                         <groupId>org.onap.sdnc.northbound</groupId>
42                         <artifactId>vnfapi-installer</artifactId>
43                         <version>${sdnc.northbound.version}</version>
44                         <classifier>repo</classifier>
45                         <type>zip</type>
46                 </dependency>
47                 <dependency>
48                         <groupId>org.onap.sdnc.northbound</groupId>
49                         <artifactId>vnftools-installer</artifactId>
50                         <version>${sdnc.northbound.version}</version>
51                         <classifier>repo</classifier>
52                         <type>zip</type>
53                 </dependency>
54                 <dependency>
55                         <groupId>org.onap.sdnc.northbound</groupId>
56                         <artifactId>sdnc-northbound-features-installer</artifactId>
57                         <version>${sdnc.northbound.version}</version>
58                         <classifier>repo</classifier>
59                         <type>zip</type>
60                 </dependency>
61         </dependencies>
62
63         <build>
64                 <plugins>
65
66
67                         <plugin>
68                                 <groupId>org.codehaus.groovy.maven</groupId>
69                                 <artifactId>gmaven-plugin</artifactId>
70                                 <executions>
71                                         <execution>
72                                                 <phase>validate</phase>
73                                                 <goals>
74                                                         <goal>execute</goal>
75                                                 </goals>
76                                                 <configuration>
77                                                         <source>
78                                                                 println project.properties['sdnc.project.version'];
79                                                                 def versionArray;
80                                                                 if ( project.properties['sdnc.project.version'] != null ) {
81                                                                     versionArray = project.properties['sdnc.project.version'].split('\\.');
82                                                                 }
83
84                                                                 if (project.properties['sdnc.project.version'].endsWith("-SNAPSHOT"))
85                                                                 {
86                                                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
87                                                                 } else {
88                                                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
89                                                                 }
90
91                                                                 println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
92                                                         </source>
93                                                 </configuration>
94                                         </execution>
95                                 </executions>
96                         </plugin>
97
98                         <plugin>
99                                 <groupId>io.fabric8</groupId>
100                                 <artifactId>docker-maven-plugin</artifactId>
101                                 <version>0.16.5</version>
102                                 <inherited>false</inherited>
103                                 <configuration>
104                                         <images>
105                                                 <image>
106                                                         <name>${image.name}</name>
107                                                         <build>
108                                                                 <cleanup>try</cleanup>
109                                                                 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
110                                                                 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
111                                                                 <tags>
112                                                                         <tag>${project.version}</tag>
113                                                                         <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
114                                                                         <tag>${project.docker.latesttag.version}</tag>
115                                                                 </tags>
116                                                         </build>
117                                                 </image>
118                                         </images>
119                                 </configuration>
120                                 <executions>
121                                         <execution>
122                                                 <id>generate-images</id>
123                                                 <phase>package</phase>
124                                                 <goals>
125                                                         <goal>build</goal>
126                                                 </goals>
127                                         </execution>
128
129                                         <execution>
130                                                 <id>push-images</id>
131                                                 <phase>${docker.push.phase}</phase>
132                                                 <goals>
133                                                         <goal>build</goal>
134                                                         <goal>push</goal>
135                                                 </goals>
136                                         </execution>
137                                 </executions>
138                         </plugin>
139
140
141
142                         <plugin>
143                                 <artifactId>maven-resources-plugin</artifactId>
144                                 <version>2.6</version>
145                                 <executions>
146                                         <execution>
147                                                 <id>copy-dockerfile</id>
148                                                 <goals>
149                                                         <goal>copy-resources</goal>
150                                                 </goals><!-- here the phase you need -->
151                                                 <phase>validate</phase>
152                                                 <configuration>
153                                                         <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
154                                                         <resources>
155                                                                 <resource>
156                                                                         <directory>src/main/docker</directory>
157                                                                         <includes>
158                                                                                 <include>Dockerfile</include>
159                                                                         </includes>
160                                                                         <filtering>true</filtering>
161                                                                 </resource>
162                                                         </resources>
163                                                 </configuration>
164                                         </execution>
165
166                                         <execution>
167                                                 <id>copy-scripts</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/bin</outputDirectory>
174                                                         <resources>
175                                                                 <resource>
176                                                                         <directory>src/main/scripts</directory>
177                                                                         <includes>
178                                                                                 <include>*.sh</include>
179                                                                         </includes>
180                                                                         <filtering>false</filtering>
181                                                                 </resource>
182                                                         </resources>
183                                                 </configuration>
184                                         </execution>
185
186                                         <execution>
187                                                 <id>copy-tarballs</id>
188                                                 <goals>
189                                                         <goal>copy-resources</goal>
190                                                 </goals><!-- here the phase you need -->
191                                                 <phase>validate</phase>
192                                                 <configuration>
193                                                         <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
194                                                         <resources>
195                                                                 <resource>
196                                                                         <directory>src/main/resources</directory>
197                                                                         <includes>
198                                                                                 <include>idmlight.db.mv.db</include>
199                                                                                 <include>AAF_RootCA.cer</include>
200                                                                                 <include>truststoreONAPall.jks</include>
201                                                                         </includes>
202                                                                         <filtering>false</filtering>
203                                                                 </resource>
204                                                         </resources>
205                                                 </configuration>
206                                         </execution>
207                                         <execution>
208                                                 <id>copy-data</id>
209                                                 <goals>
210                                                         <goal>copy-resources</goal>
211                                                 </goals><!-- here the phase you need -->
212                                                 <phase>validate</phase>
213                                                 <configuration>
214                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data</outputDirectory>
215                                                         <resources>
216                                                                 <resource>
217                                                                         <directory>src/main/resources</directory>
218                                                                         <includes>
219                                                                                 <include>*.dump</include>
220                                                                         </includes>
221                                                                         <filtering>false</filtering>
222                                                                 </resource>
223                                                         </resources>
224                                                 </configuration>
225                                         </execution>
226                                         <execution>
227                                                 <id>copy-properties</id>
228                                                 <goals>
229                                                         <goal>copy-resources</goal>
230                                                 </goals><!-- here the phase you need -->
231                                                 <phase>validate</phase>
232                                                 <configuration>
233                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</outputDirectory>
234                                                         <resources>
235                                                                 <resource>
236                                                                         <directory>../src/main/properties</directory>
237                                                                         <includes>
238                                                                                 <include>*.properties</include>
239                                                                         </includes>
240                                                                         <filtering>false</filtering>
241                                                                 </resource>
242                                                         </resources>
243                                                 </configuration>
244                                         </execution>
245                                         <execution>
246                                                 <id>copy-keystores</id>
247                                                 <goals>
248                                                         <goal>copy-resources</goal>
249                                                 </goals><!-- here the phase you need -->
250                                                 <phase>validate</phase>
251                                                 <configuration>
252                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/stores</outputDirectory>
253                                                         <resources>
254                                                                 <resource>
255                                                                         <directory>../src/main/stores</directory>
256                                                                         <includes>
257                                                                                 <include>*.jks</include>
258                                                                         </includes>
259                                                                         <filtering>false</filtering>
260                                                                 </resource>
261                                                         </resources>
262                                                 </configuration>
263                                         </execution>
264                                 </executions>
265                         </plugin>
266                         <plugin>
267                                 <groupId>org.apache.maven.plugins</groupId>
268                                 <artifactId>maven-dependency-plugin</artifactId>
269                                 <version>3.0.2</version>
270                                 <executions>
271                                         <execution>
272                                                 <id>unpack sdnc features</id>
273                                                 <phase>generate-sources</phase>
274                                                 <goals>
275                                                         <goal>unpack-dependencies</goal>
276                                                 </goals>
277                                                 <configuration>
278                                                         <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
279                                                         <excludeTransitive>true</excludeTransitive>
280                                                 </configuration>
281                                         </execution>
282                                         <execution>
283                                                 <id>unpack dgs</id>
284                                                 <phase>generate-sources</phase>
285                                                 <goals>
286                                                         <goal>unpack</goal>
287                                                 </goals>
288                                                 <configuration>
289                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc</outputDirectory>
290                                                         <artifactItems>
291                                                                 <artifactItem>
292                                                                         <groupId>${project.groupId}</groupId>
293                                                                         <artifactId>platform-logic-installer</artifactId>
294                                                                         <version>${project.version}</version>
295                                                                         <type>zip</type>
296                                                                 </artifactItem>
297                                                         </artifactItems>
298                                                 </configuration>
299                                         </execution>
300                                 </executions>
301                         </plugin>
302                         <plugin>
303                                 <artifactId>exec-maven-plugin</artifactId>
304                                 <groupId>org.codehaus.mojo</groupId>
305                                 <version>1.5.0</version>
306                                 <executions>
307
308                                         <execution>
309                                                 <id>change shell permissions</id>
310                                                 <phase>process-sources</phase>
311                                                 <goals>
312                                                         <goal>exec</goal>
313                                                 </goals>
314                                                 <configuration>
315                                                         <executable>/usr/bin/find</executable>
316                                                         <arguments>
317                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
318                                                                 <argument>-name</argument>
319                                                                 <argument>*.sh</argument>
320                                                                 <argument>-exec</argument>
321                                                                 <argument>chmod</argument>
322                                                                 <argument>+x</argument>
323                                                                 <argument>{}</argument>
324                                                                 <argument>;</argument>
325                                                         </arguments>
326                                                 </configuration>
327                                         </execution>
328                                 </executions>
329                         </plugin>
330
331
332                 </plugins>
333
334         </build>
335         <organization>
336                 <name>ONAP</name>
337         </organization>
338 </project>