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