Merge "Updated Remote Ansible component to retrieve all artifacts and logs produced...
[ccsdk/cds.git] / ms / sdclistener / distribution / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   ~  Copyright © 2019 IBM, Bell Canada.
4   ~
5   ~  Licensed under the Apache License, Version 2.0 (the "License");
6   ~  you may not use this file except in compliance with the License.
7   ~  You may obtain a copy of the License at
8   ~
9   ~      http://www.apache.org/licenses/LICENSE-2.0
10   ~
11   ~  Unless required by applicable law or agreed to in writing, software
12   ~  distributed under the License is distributed on an "AS IS" BASIS,
13   ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   ~  See the License for the specific language governing permissions and
15   ~  limitations under the License.
16   -->
17 <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">
18     <modelVersion>4.0.0</modelVersion>
19
20     <parent>
21         <groupId>org.onap.ccsdk.cds.sdclistener</groupId>
22         <artifactId>parent</artifactId>
23         <version>0.7.0-SNAPSHOT</version>
24         <relativePath>../parent</relativePath>
25     </parent>
26
27     <artifactId>distribution</artifactId>
28     <packaging>pom</packaging>
29
30     <name>SDC Listener Distribution</name>
31
32     <properties>
33         <assembly.id>maven</assembly.id>
34         <name.space>org.onap.ccsdk.cds</name.space>
35         <serviceArtifactName>sdclistener</serviceArtifactName>
36         <image.name>onap/ccsdk-sdclistener</image.name>
37         <!--disabled for now to mirror #85964 https://gerrit.onap.org/r/#/c/85964/2/ms/command-executor/pom.xml-->
38         <!--<docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>-->
39         <docker.push.phase>deploy</docker.push.phase>
40         <docker.verbose>true</docker.verbose>
41         <ccsdk.project.version>${project.version}</ccsdk.project.version>
42         <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
43     </properties>
44
45     <dependencies>
46         <dependency>
47             <groupId>org.onap.ccsdk.cds.sdclistener</groupId>
48             <artifactId>application</artifactId>
49         </dependency>
50     </dependencies>
51
52     <build>
53         <plugins>
54             <plugin>
55                 <artifactId>maven-resources-plugin</artifactId>
56                 <version>2.6</version>
57                 <executions>
58                     <execution>
59                         <id>copy-dockerfile</id>
60                         <goals>
61                             <goal>copy-resources</goal>
62                         </goals><!-- here the phase you need -->
63                         <phase>validate</phase>
64                         <configuration>
65                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
66                             <resources>
67                                 <resource>
68                                     <directory>src/main/docker</directory>
69                                     <includes>
70                                         <include>*</include>
71                                     </includes>
72                                     <filtering>true</filtering>
73                                 </resource>
74                             </resources>
75                         </configuration>
76                     </execution>
77                 </executions>
78             </plugin>
79             <plugin>
80                 <groupId>org.apache.maven.plugins</groupId>
81                 <artifactId>maven-antrun-plugin</artifactId>
82                 <executions>
83                     <execution>
84                         <id>ant-test</id>
85                         <phase>package</phase>
86                         <configuration>
87                             <tasks>
88                                 <fixcrlf srcdir="${basedir}" eol="unix" includes="**/*.sh, **/*.source" />
89                             </tasks>
90                         </configuration>
91                         <goals>
92                             <goal>run</goal>
93                         </goals>
94                     </execution>
95                 </executions>
96             </plugin>
97             <plugin><!--build the final artifact for docker deployment -->
98                 <artifactId>maven-assembly-plugin</artifactId>
99                 <version>3.1.0</version>
100                 <configuration>
101                     <!-- <skipAssembly>${skip.assembly}</skipAssembly> -->
102                     <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
103                     <descriptors>
104                         <descriptor>src/main/docker/distribution.xml</descriptor>
105                     </descriptors>
106                     <tarLongFileMode>posix</tarLongFileMode>
107                 </configuration>
108                 <executions>
109                     <execution>
110                         <id>${assembly.id}</id>
111                         <phase>package</phase>
112                         <goals>
113                             <goal>single</goal>
114                         </goals>
115                     </execution>
116                 </executions>
117             </plugin>
118             <plugin>
119                 <groupId>org.codehaus.groovy.maven</groupId>
120                 <artifactId>gmaven-plugin</artifactId>
121                 <version>1.0</version>
122                 <executions>
123                     <execution>
124                         <phase>validate</phase>
125                         <goals>
126                             <goal>execute</goal>
127                         </goals>
128                         <configuration>
129                             <source>${basedir}/../../../TagVersion.groovy</source>
130                         </configuration>
131                     </execution>
132                 </executions>
133             </plugin>
134
135         </plugins>
136     </build>
137
138     <profiles>
139         <profile>
140             <id>docker</id>
141             <build>
142                 <plugins>
143                     <plugin>
144                         <groupId>io.fabric8</groupId>
145                         <artifactId>docker-maven-plugin</artifactId>
146                         <version>0.26.1</version>
147                         <inherited>false</inherited>
148                         <configuration>
149                             <images>
150                                 <image>
151                                     <name>${image.name}</name>
152                                     <build>
153                                         <cleanup>try</cleanup>
154                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
155                                         <tags>
156                                             <tag>${project.docker.latestminortag.version}</tag>
157                                             <tag>${project.docker.latestfulltag.version}</tag>
158                                             <tag>${project.docker.latesttagtimestamp.version}</tag>
159                                         </tags>
160                                     </build>
161                                 </image>
162                             </images>
163                             <verbose>true</verbose>
164                         </configuration>
165                         <executions>
166                             <execution>
167                                 <id>generate-images</id>
168                                 <phase>package</phase>
169                                 <goals>
170                                     <goal>build</goal>
171                                 </goals>
172                             </execution>
173                             <execution>
174                                 <id>push-images</id>
175                                 <phase>${docker.push.phase}</phase>
176                                 <goals>
177                                     <goal>build</goal>
178                                     <goal>push</goal>
179                                 </goals>
180                             </execution>
181                         </executions>
182                     </plugin>
183                 </plugins>
184             </build>
185         </profile>
186     </profiles>
187 </project>