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