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