Auto discover and register all robot test cases
[cli.git] / deployment / zip / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3     Copyright 2017 Huawei Technologies Co., Ltd.
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"
18          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
20          http://maven.apache.org/xsd/maven-4.0.0.xsd">
21     <modelVersion>4.0.0</modelVersion>
22
23     <parent>
24         <groupId>org.onap.cli</groupId>
25         <artifactId>cli-deployment</artifactId>
26         <version>6.0.0-SNAPSHOT</version>
27     </parent>
28
29     <artifactId>cli-zip</artifactId>
30     <name>cli/deployment/zip</name>
31     <packaging>pom</packaging>
32
33     <build>
34         <plugins>
35             <plugin>
36                 <groupId>org.codehaus.gmaven</groupId>
37                 <artifactId>gmaven-plugin</artifactId>
38                 <version>1.5</version>
39                 <executions>
40                     <execution>
41                         <id>open-cli-deployment</id>
42                         <phase>package</phase>
43                         <goals>
44                             <goal>execute</goal>
45                         </goals>
46                         <configuration>
47                             <source>
48                                 System.out.println("******** Going to make release zip ********")
49
50                                 deployFolder =
51                                 "${project.build.directory}/deployoutput"
52                                 deployUnzip =
53                                 "${project.build.directory}/deployunzip"
54                                 outfileName =
55                                 "${package.name}-${project.version}.zip"
56                                 ant.delete(dir: "${deployFolder}")
57                                 ant.mkdir(dir: "${deployFolder}")
58
59                                 ant.delete(dir: "${deployUnzip}")
60                                 ant.mkdir(dir: "${deployUnzip}")
61
62                                 ant.delete(dir: "${deployUnzip}/lib")
63                                 ant.mkdir(dir: "${deployUnzip}/lib")
64
65                                 ant.delete(dir: "${deployUnzip}/open-cli-schema")
66                                 ant.mkdir(dir: "${deployUnzip}/open-cli-schema")
67
68                                 ant.delete(dir: "${deployUnzip}/open-cli-sample")
69                                 ant.mkdir(dir: "${deployUnzip}/open-cli-sample")
70
71                                 ant.delete(dir: "${deployUnzip}/data")
72                                 ant.mkdir(dir: "${deployUnzip}/data")
73
74                                 ant.delete(dir: "${deployUnzip}/data/tmp")
75                                 ant.mkdir(dir: "${deployUnzip}/data/tmp")
76
77                                 ant.delete(dir: "${deployUnzip}/script")
78                                 ant.mkdir(dir: "${deployUnzip}/script")
79
80                                 ant.copy(todir: "${deployUnzip}") {
81                                 fileset(dir: "${basedir}/src/main/release"){
82                                 exclude(name: "**/.gitignore")
83                                 }
84                                 }
85
86                                 ant.copy(todir: "${deployUnzip}") {
87                                 fileset(file: "${basedir}/installer/install.sh")
88                                 }
89                                 ant.chmod(file: "${deployUnzip}/bin/oclip.sh", perm: "ugo+x")
90                                 ant.chmod(file: "${deployUnzip}/install.sh", perm: "ugo+x")
91
92                                 ant.copy(todir:
93                                 "${deployUnzip}/lib") {
94                                 fileset(file:
95                                 "${project.build.directory}/../../../main/target/cli-main-${project.version}.jar")
96                                 fileset(dir:
97                                 "${project.build.directory}/../../../main/target/lib/")
98                                 fileset(dir:
99                                 "${project.build.directory}/../../../products/target/lib/")
100                                 fileset(dir:
101                                 "${project.build.directory}/../../../profiles/target/lib/")
102                                 fileset(dir:
103                                 "${project.build.directory}/../../../grpc/target/lib/")
104                                 }
105
106                                 ant.copy(todir:
107                                 "${deployUnzip}/conf") {
108                                 fileset(dir:
109                                 "${project.build.directory}/../../../products/target/conf/",
110                                 erroronmissingdir: false)
111                                 fileset(dir:
112                                 "${project.build.directory}/../../../profiles/target/conf/",
113                                 erroronmissingdir: false)
114                                 fileset(file:
115                                 "${basedir}/src/main/release/conf/*.properties")
116                                 }
117
118                                 ant.copy(todir:
119                                 "${deployUnzip}/script") {
120                                 fileset(dir:
121                                 "${project.build.directory}/../../../products/target/script/",
122                                 erroronmissingdir: false)
123                                 fileset(dir:
124                                 "${project.build.directory}/../../../profiles/target/script/",
125                                 erroronmissingdir: false)
126                                 }
127
128                                 ant.copy(todir:
129                                 "${deployUnzip}/docs") {
130                                 fileset(file:
131                                 "${project.build.directory}/../../../README.md")
132                                 }
133
134                                 ant.zip(destfile:
135                                 "${deployFolder}/${outfileName}") {
136                                 zipfileset(dir: "${deployUnzip}", excludes: "**/*.sh")
137                                 zipfileset(dir: "${deployUnzip}", includes: "**/*.sh", filemode: "755")
138                                 }
139                                 System.out.println("******** completed. ************")
140                             </source>
141                         </configuration>
142                     </execution>
143                 </executions>
144             </plugin>
145             <plugin>
146                 <groupId>org.codehaus.mojo</groupId>
147                 <artifactId>build-helper-maven-plugin</artifactId>
148                 <version>3.0.0</version>
149                 <executions>
150                     <execution>
151                         <id>attach-artifacts</id>
152                         <phase>package</phase>
153                         <goals>
154                             <goal>attach-artifact</goal>
155                         </goals>
156                         <configuration>
157                             <artifacts>
158                                 <artifact>
159                                     <file>${project.build.directory}/deployoutput/${package.name}-${project.version}.zip</file>
160                                     <type>zip</type>
161                                 </artifact>
162                             </artifacts>
163                         </configuration>
164                     </execution>
165                 </executions>
166             </plugin>
167         </plugins>
168     </build>
169 </project>