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