forked from bejean/crawl-anywhere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·229 lines (194 loc) · 7.58 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
#!/bin/bash
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
export COPYFILE_DISABLE=true
export DEV=$(pwd)
export VERSION=4.0.0
export DISTRIB=$DEV/build
export RSYNCFLAGS="-au"
#=============================================
# some clean-up
#=============================================
find . -name .DS_Store -type f -exec rm {} \;
mkdir $DISTRIB
export DISTRIB=$DISTRIB/$VERSION
mkdir $DISTRIB
#=============================================
# readme
#=============================================
cp -r $DEV/*.txt $DISTRIB/.
#=============================================
# install
#=============================================
mkdir $DISTRIB/install
mkdir $DISTRIB/install/crawler
cp -r $DEV/install/* $DISTRIB/install/.
#=============================================
# externals
#=============================================
cp -r $DEV/external $DISTRIB/.
#=============================================
# scripts
#============================================
cp -r $DEV/scripts $DISTRIB/.
#=============================================
# crawler
#=============================================
#=============================================
# simplepipeline
#=============================================
#=============================================
# indexer
#=============================================
#=============================================
# jar
#=============================================
mkdir $DISTRIB/bin
mkdir $DISTRIB/lib
# all
cd $DEV/java
mvn clean
mvn package -Dmaven.test.skip=true
# utils
cd $DEV/java/utils
#mvn clean
#mvn package -Dmaven.test.skip=true
rm -rf $DEV/java/utils/target/dependency
#mvn dependency:copy-dependencies
cp target/utils-0.0.1-SNAPSHOT.jar $DISTRIB/bin/eolya-utils-$VERSION.jar
# crawler
cd $DEV/java/crawler
#mvn clean
#mvn package -Dmaven.test.skip=true
rm -rf $DEV/java/crawler/target/dependency
#mvn dependency:copy-dependencies
cp target/crawler-0.0.1-SNAPSHOT.jar $DISTRIB/bin/eolya-crawler-$VERSION.jar
# simplepipeline
cd $DEV/java/simplepipeline
#mvn clean
#mvn package -Dmaven.test.skip=true
rm -rf $DEV/java/simplepipeline/dependency
#mvn dependency:copy-dependencies
cp target/pipeline-0.0.1-SNAPSHOT.jar $DISTRIB/bin/eolya-pipeline-$VERSION.jar
# indexer
cd $DEV/java/indexer
#mvn clean
#mvn package -Dmaven.test.skip=true
rm -rf $DEV/java/indexer/dependency
#mvn dependency:copy-dependencies
cp target/indexer-0.0.1-SNAPSHOT.jar $DISTRIB/bin/eolya-indexer-$VERSION.jar
## solr
cd $DEV/java/solr
#mvn clean
#mvn package -Dmaven.test.skip=true
rm -rf $DEV/java/solr/target/dependency
#mvn dependency:copy-dependencies
#rm target/dependency/*lucene*
#rm target/dependency/*solr*
mkdir $DISTRIB/install/solr/solr430/lib
cp target/solr-0.0.1-SNAPSHOT.jar $DISTRIB/install/solr/solr430/lib/eolya-solr4.jar
#cp target/dependency/*.jar $DISTRIB/install/solr/solr430/lib/.
## solr3
#cd $DEV/java/solr
#mvn clean
#mvn package -Dmaven.test.skip=true
#rm -rf $DEV/java/solr/target/dependency
#mvn dependency:copy-dependencies
#rm target/dependency/*lucene*
#rm target/dependency/*solr*
#
##rm $DEV/install/bin/solr3/*
#
#mkdir $DISTRIB/install/solr/solr310/crawler/lib
#cp target/solr-0.0.1-SNAPSHOT.jar $DISTRIB/install/solr/solr310/crawler/lib/eolya-solr3.jar
#cp target/dependency/*.jar $DISTRIB/install/solr/solr310/crawler/lib/.
#
#mkdir $DISTRIB/install/solr/solr350/crawler/lib
#cp target/solr-0.0.1-SNAPSHOT.jar $DISTRIB/install/solr/solr350/crawler/lib/eolya-solr3.jar
#cp target/dependency/*.jar $DISTRIB/install/solr/solr350/crawler/lib/.
#
## solr4
#cd $DEV/java/solr4
#mvn clean
#mvn package -Dmaven.test.skip=true
#rm -rf $DEV/java/solr4/target/dependency
#mvn dependency:copy-dependencies
#rm target/dependency/*lucene*
#rm target/dependency/*solr*
#
##rm $DEV/install/bin/solr4/*
#
#mkdir $DISTRIB/install/solr/solr400/crawler/lib
#cp target/solr4-0.0.1-SNAPSHOT.jar $DISTRIB/install/solr/solr400/crawler/lib/eolya-solr4.jar
#cp target/dependency/*.jar $DISTRIB/install/solr/solr400/crawler/lib/.
#=============================================
# crawler WS
#=============================================
mkdir -p $DISTRIB/install/crawler/tomcat
cd $DEV/java/crawlerws
#mvn clean
#mvn package -Dmaven.test.skip=true
cp target/crawlerws-0.0.1-SNAPSHOT.war $DISTRIB/install/crawler/tomcat/crawlerws-$VERSION.war
#cp $DEV/install/bin/tomcat/crawlerws-jndi*.xml $DISTRIB/install/crawler/tomcat/.
cp config/crawlerws/crawlerws-default.xml $DISTRIB/install/crawler/tomcat/.
#cp target/crawlerws-0.0.1-SNAPSHOT.war $DEV/install/bin/tomcat/crawlerws-$VERSION.war
#=============================================
# lib
#=============================================
cd $DEV/java
mvn install:install-file -DgroupId=fr.eolya -DartifactId=utils -Dversion=0.0.1-SNAPSHOT -Dpackaging=jar -Dfile=utils/target/utils-0.0.1-SNAPSHOT.jar
mvn dependency:copy-dependencies
cp -r $DEV/java/crawler/target/dependency/* $DISTRIB/lib/.
cp -r $DEV/java/simplepipeline/target/dependency/* $DISTRIB/lib/.
cp -r $DEV/java/indexer/target/dependency/* $DISTRIB/lib/.
cp -r $DEV/java/utils/target/dependency/* $DISTRIB/lib/.
rm $DISTRIB/lib/utils-0.0.1-SNAPSHOT.jar
rm $DISTRIB/lib/commons-lang-*.jar
#=============================================
# web
#=============================================
mkdir $DISTRIB/web
cp -r $DEV/web/crawler/src $DISTRIB/web/crawler
rm -rf $DISTRIB/web/crawler/config/*
cp $DEV/web/crawler/src/config/config-default.ini $DISTRIB/web/crawler/config/.
sed -e "s/#version#/$VERSION/" $DISTRIB/web/crawler/pub/ressources/mongodb/init_db-infos.json > $DISTRIB/web/crawler/pub/ressources/mongodb/init_db-infos.json.2
rm $DISTRIB/web/crawler/pub/ressources/mongodb/init_db-infos.json
mv $DISTRIB/web/crawler/pub/ressources/mongodb/init_db-infos.json.2 $DISTRIB/web/crawler/pub/ressources/mongodb/init_db-infos.json
cp -r $DEV/web/search/src $DISTRIB/web/search
rm -rf $DISTRIB/web/search/config/*
cp $DEV/web/search/src/config/config-default.ini $DISTRIB/web/search/config/.
#perl -pi -e 's/\r\n/\n/g' $DISTRIB/web/search/config/config-default.ini
find $DISTRIB/web -name '.svn' -exec rm -rf {} \;
#=============================================
# bin / config
#=============================================
mkdir -p $DISTRIB/config/crawler
cp $DEV/java/crawler/config/crawler/crawler-default.xml $DISTRIB/config/crawler/.
cp -r $DEV/java/crawler/config/crawler/scripts $DISTRIB/config/crawler/.
mkdir -p $DISTRIB/config/pipeline
cp $DEV/java/simplepipeline/config/pipeline/simplepipeline-default.xml $DISTRIB/config/pipeline/.
cp $DEV/java/simplepipeline/config/pipeline/solrmapping.xml $DISTRIB/config/pipeline/.
cp $DEV/java/simplepipeline/config/pipeline/solrboost.xml $DISTRIB/config/pipeline/.
cp $DEV/java/simplepipeline/config/pipeline/contenttypemapping.txt $DISTRIB/config/pipeline/.
cp $DEV/java/simplepipeline/config/pipeline/countrymapping.txt $DISTRIB/config/pipeline/.
cp -r $DEV/java/simplepipeline/config/pipeline/scripts $DISTRIB/config/pipeline/.
mkdir -p $DISTRIB/config/indexer
cp $DEV/java/indexer/config/indexer/indexer-default.xml $DISTRIB/config/indexer/.
cp -r $DEV/java/utils/config/* $DISTRIB/config/.
#=============================================
# tar
#=============================================
cd $DISTRIB
find $DISTRIB -name .DS_Store -type f -exec rm {} \;
tar cfz crawl-anywhere-external.tar.gz external
tar cfz crawl-anywhere-dependencies-jar-$VERSION.tar.gz lib
tar cfz crawl-anywhere-$VERSION.tar.gz bin config scripts web install *.txt
#=============================================
# clean up
#=============================================
#rm -rf $DISTRIB/lib
#rm -rf $DISTRIB/external
#rm -rf $DISTRIB/utils
#rm -rf $DISTRIB/crawler
#rm -rf $DISTRIB/simplepipeline
#rm -rf $DISTRIB/indexer
#rm -rf $DISTRIB/solr