JJB migration
[msb/apigateway.git] / distributions / msb-apigateway / 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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3   <parent>
4     <groupId>org.onap.msb.apigateway.distributions</groupId>
5     <artifactId>distributions-parent</artifactId>
6     <version>1.2.5-SNAPSHOT</version>
7   </parent>
8   <modelVersion>4.0.0</modelVersion>
9   <groupId>org.onap.msb.apigateway.distributions</groupId>
10   <artifactId>msb-apigateway</artifactId>
11   <version>1.2.5-SNAPSHOT</version>
12   <name>onap/msb/apigateway/distributions/msb-apigateway</name>
13   <packaging>pom</packaging>
14
15   <properties>
16     <packageid>msb-apigateway</packageid>
17     <version.output>${project.basedir}/target/version</version.output>
18     <docker.image.name>onap/msb/msb_apigateway</docker.image.name>
19     <docker.tag>${project.version}-${timestamp}</docker.tag>
20     <docker.latest.tag>${project.version}-latest</docker.latest.tag>
21   </properties>
22
23   <profiles>
24     <profile>
25       <id>linux</id>
26       <activation>
27           <activeByDefault>true</activeByDefault>
28       </activation>
29       <dependencies>
30         <dependency>
31             <groupId>org.onap.msb.apigateway.apiroute</groupId>
32             <artifactId>apiroute-standalone</artifactId>
33             <type>zip</type>
34             <version>${project.version}</version>
35             <optional>true</optional>
36         </dependency>
37
38
39         <dependency>
40             <groupId>org.onap.msb.apigateway</groupId>
41             <artifactId>redis-ext</artifactId>
42             <type>tar.gz</type>
43             <classifier>${classifier.linux64}</classifier>
44             <version>${project.version}</version>
45             <optional>true</optional>
46         </dependency>
47
48         <dependency>
49           <groupId>org.onap.msb.apigateway</groupId>
50           <artifactId>openresty-ext</artifactId>
51           <type>tar.gz</type>
52           <classifier>${classifier.linux64}</classifier>
53           <version>${project.version}</version>
54           <optional>true</optional>
55         </dependency>
56       </dependencies>
57
58       <build>
59       <plugins>
60         <plugin>
61           <groupId>org.apache.maven.plugins</groupId>
62           <artifactId>maven-dependency-plugin</artifactId>
63           <executions>
64             <execution>
65                 <id>unpacktolinux64</id>
66                 <goals>
67                     <goal>unpack</goal>
68                 </goals>
69                 <phase>prepare-package</phase>
70                 <configuration>
71                   <artifactItems>
72                       <artifactItem>
73                         <groupId>org.onap.msb.apigateway.apiroute</groupId>
74                         <artifactId>apiroute-standalone</artifactId>
75                         <type>zip</type>
76                       </artifactItem>
77                       <artifactItem>
78                         <groupId>org.onap.msb.apigateway</groupId>
79                         <artifactId>redis-ext</artifactId>
80                         <type>tar.gz</type>
81                         <classifier>${classifier.linux64}</classifier>
82                       </artifactItem>
83                       <artifactItem>
84                         <groupId>org.onap.msb.apigateway</groupId>
85                         <artifactId>openresty-ext</artifactId>
86                         <type>tar.gz</type>
87                         <classifier>${classifier.linux64}</classifier>
88                       </artifactItem>
89                   </artifactItems>
90                   <excludes>**/*.bat,**/*.cmd,**/*.exe</excludes>
91                   <outputDirectory>${linux64outputdir}</outputDirectory>
92                   <overWriteReleases>false</overWriteReleases>
93                   <overWriteSnapshots>true</overWriteSnapshots>
94                   <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
95                 </configuration>
96             </execution>
97           </executions>
98         </plugin>
99
100         <plugin>
101           <artifactId>maven-resources-plugin</artifactId>
102           <executions>
103             <execution>
104               <id>copy-msb-resources-linux</id>
105               <phase>prepare-package</phase>
106               <goals>
107                 <goal>copy-resources</goal>
108               </goals>
109               <configuration>
110                 <outputDirectory>${linux64outputdir}</outputDirectory>
111                 <includeEmptyDirs>true</includeEmptyDirs>
112                 <resources>
113                   <resource>
114                     <directory>src/assembly/resources/</directory>
115                     <filtering>false</filtering>
116                     <includes>
117                       <include>**/*</include>
118                     </includes>
119                     <excludes>
120                       <exclude>**/*.bat</exclude>
121                     </excludes>
122                   </resource>
123                 </resources>
124                 <overwrite>true</overwrite>
125               </configuration>
126             </execution>
127             <execution>
128               <id>copy-resources-dockerfile</id>
129               <phase>process-resources</phase>
130               <goals>
131                 <goal>copy-resources</goal>
132               </goals>
133               <configuration>
134                 <outputDirectory>${version.output}</outputDirectory>
135                 <includeEmptyDirs>true</includeEmptyDirs>
136                 <resources>
137                   <resource>
138                     <directory>${dockerFileDir}</directory>
139                     <filtering>false</filtering>
140                     <includes>
141                       <include>**/*</include>
142                     </includes>
143                   </resource>
144                 </resources>
145                 <overwrite>true</overwrite>
146               </configuration>
147             </execution>
148           </executions>
149         </plugin>
150
151         <plugin>
152           <groupId>org.apache.maven.plugins</groupId>
153           <artifactId>maven-antrun-plugin</artifactId>
154           <executions>
155             <execution>
156               <id>distribution</id>
157               <phase>package</phase>
158               <goals>
159                 <goal>run</goal>
160               </goals>
161               <configuration>
162                 <target name="distribution">
163
164                   <tstamp>
165                     <format property="last.updated" pattern="yyyy-MM-dd HH:mm:ss"/>
166                   </tstamp>
167                   <echo file="${linux64outputdir}/msb.version.properties" message="build.time=${last.updated}${line.separator}build.version=${project.version}"/>
168                   <tar destfile="${version.output}/${packageid}-${project.version}-${classifier.linux64}.tar.gz" longfile="posix" compression="gzip">
169                     <tarfileset dir="${linux64outputdir}" prefix="${packageid}" filemode="0644" dirmode="0755">
170                       <exclude name="**/*.sh"/>
171                       <exclude name="openresty/nginx/sbin/nginx"/>
172                       <exclude name="redis/redis-*"/>
173                     </tarfileset>
174                     <tarfileset dir="${linux64outputdir}" prefix="${packageid}" filemode="0755" dirmode="0755">
175                       <include name="**/*.sh"/>
176                       <include name="openresty/nginx/sbin/nginx"/>
177                       <include name="redis/redis-*"/>
178                     </tarfileset>
179                   </tar>
180                 </target>
181               </configuration>
182             </execution>
183           </executions>
184         </plugin>
185         </plugins>
186       </build>
187     </profile>
188     <profile>
189       <id>docker</id>
190       <build>
191           <plugins>
192                <plugin>
193                         <groupId>io.fabric8</groupId>
194                         <artifactId>docker-maven-plugin</artifactId>
195                         <version>0.19.1</version>
196                         <dependencies>
197                             <dependency>
198                                 <groupId>com.github.jnr</groupId>
199                                 <artifactId>jnr-unixsocket</artifactId>
200                                 <version>0.13</version>
201                             </dependency>
202                         </dependencies>
203                         <configuration>
204                             <verbose>true</verbose>
205                             <apiVersion>1.23</apiVersion>
206                             <registry>nexus3.onap.org:10003</registry>
207                             <images>
208                                 <image>
209                                     <name>${docker.image.name}</name>
210                                     <alias>docker_msb_apigateway</alias>
211                                     <build>
212                                         <cleanup>true</cleanup>
213                                         <tags>
214                                             <tag>${docker.tag}</tag>
215                                             <tag>${docker.latest.tag}</tag>
216                                         </tags>
217                                         <dockerFileDir>${version.output}</dockerFileDir>
218                                         <!--assembly>
219                                             <descriptorRef>artifact</descriptorRef>
220                                         </assembly-->
221                                     </build>
222                                 </image>
223                             </images>
224                         </configuration>
225                         <executions>
226                             <execution>
227                                 <id>clean-images</id>
228                                 <phase>pre-clean</phase>
229                                 <goals>
230                                     <goal>remove</goal>
231                                 </goals>
232                                 <configuration>
233                                     <removeAll>true</removeAll>
234                                     <image>docker_msb_apigateway</image>
235                                 </configuration>
236                             </execution>
237                             <execution>
238                                 <id>generate-images</id>
239                                 <phase>package</phase>
240                                 <goals>
241                                     <goal>build</goal>
242                                 </goals>
243                             </execution>
244                             <execution>
245                                 <id>push-images</id>
246                                 <phase>deploy</phase>
247                                 <goals>
248                                     <goal>push</goal>
249                                 </goals>
250                                 <configuration>
251                                     <image>${docker.image.name}</image>
252                                 </configuration>
253                             </execution>
254                         </executions>
255                     </plugin>  
256           </plugins>
257       </build>
258     </profile>
259   </profiles>
260
261 </project>