forked from shmsoft/FreeEed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release_freeeed_complete.sh
executable file
·150 lines (109 loc) · 3.75 KB
/
release_freeeed_complete.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
#!/usr/bin/env bash
if [ -z "${ZIP_PASS}" ]; then
echo Zip password not set
exit
fi
if [ -z "${SHMSOFT_HOME}" ]; then
echo SHMSoft_HOME not set
exit
fi
PROJECT_DIR=$SHMSOFT_HOME
RELEASE_DIR=$PROJECT_DIR/release
FREEEED_PROJECT=$PROJECT_DIR/FreeEed
FREEEED_UI_PROJECT=$PROJECT_DIR/FreeEedUI
#============================ user setup ==================================
UPLOAD_TO_S3_FREEEED_PLAYER=false
UPLOAD_TO_S3_FREEEED_UI=false
UPLOAD_TO_S3_FREEEED_PACK=true
BUILD_FREEEED_PLAYER=true
BUILD_FREEEED_UI=true
BUILD_FREEEED_PACK=true
VERSION=8.0.6
cd $SHMSoft_HOME || exit
mkdir $RELEASE_DIR
cd $RELEASE_DIR || exit
rm -rf $VERSION
mkdir $VERSION
cd $VERSION || exit
CURR_DIR=$(pwd)
echo "Working dir: $CURR_DIR"
if [ "$BUILD_FREEEED_PLAYER" == true ]; then
echo "FreeEed: mvn clean install"
cd $FREEEED_PROJECT/freeeed-processing || exit
mvn clean install;
echo "FreeEed: mvn package assembly:single"
cd $FREEEED_PROJECT/freeeed-processing || exit
mvn package assembly:single
cd $CURR_DIR || exit
mkdir tmp
cd tmp || exit
echo "FreeEed: Copying resources to: $CURR_DIR/tmp"
cp -R $FREEEED_PROJECT/freeeed-processing FreeEed
cd FreeEed || exit
cp src/main/resources/log4j.properties config/
chmod +x prepare-clean-for-release.sh
echo "FreeEed: cleaning up...."
dos2unix prepare-clean-for-release.sh
./prepare-clean-for-release.sh
cp settings-template.properties settings.properties
sed -i '/download-link/d' settings.properties
echo "download-link=http://shmsoft.s3.amazonaws.com/releases/FreeEed-$VERSION.zip" >>settings.properties
dos2unix config/hadoop-env.sh
cd $CURR_DIR/tmp || exit
echo "FreeEed: Creating zip file"
zip -P $ZIP_PASS -r FreeEed-$VERSION.zip FreeEed
cd $CURR_DIR || exit
mv tmp/FreeEed-$VERSION.zip .
echo "FreeEed: Done -- $(ls -la FreeEed-*.zip)"
fi
if [ "$BUILD_FREEEED_UI" == true ]; then
cd $CURR_DIR || exit
cp -R $FREEEED_UI_PROJECT FreeEedUI
echo "FreeEed UI: creating war file"
cd FreeEedUI || exit;
mvn clean install war:war
cd $CURR_DIR || exit
cp FreeEedUI/target/freeeedui*.war .
mv freeeedui*.war freeeedui-$VERSION.war
echo "FreeEed UI: Done -- `ls -la freeeedui*.war`"
fi
if [ "$BUILD_FREEEED_PACK" == true ]; then
cd $CURR_DIR/tmp || exit
echo "Downloading tomcat..."
wget https://s3.amazonaws.com/shmsoft/release-artifacts/freeeed-tomcat.zip
echo "Unzipping tomcat..."
unzip freeeed-tomcat.zip
rm freeeed-tomcat.zip
mv apache-tomcat* freeeed-tomcat
cp ../freeeedui-$VERSION.war freeeed-tomcat/webapps/freeeedui.war
echo "Downloading Solr... "
wget https://s3.amazonaws.com/shmsoft/release-artifacts/freeeed-solr.zip
echo "Unzipping solr... "
unzip freeeed-solr.zip
rm freeeed-solr.zip
mv apache-solr* freeeed-solr
cp $FREEEED_PROJECT/start_all.bat .
cp $FREEEED_PROJECT/start_all.sh .
cp $FREEEED_PROJECT/stop_all.sh .
cd $CURR_DIR || exit
mv tmp freeeed_complete_pack
zip -P $ZIP_PASS -r freeeed_complete_pack-$VERSION.zip freeeed_complete_pack
echo "Done -- `ls -la freeeed_complete*.zip`"
fi
if [ "$UPLOAD_TO_S3_FREEEED_PLAYER" == true ]; then
echo "Uploading $VERSION/FreeEed-$VERSION.zip to s3://shmsoft/releases/"
echo "CURR_DIR=" $CURR_DIR
cd $CURR_DIR || exit
s3cmd -P put FreeEed-$VERSION.zip s3://shmsoft/releases/
fi
if [ "$UPLOAD_TO_S3_FREEEED_UI" == true ]; then
echo "Uploading to S3.... freeeedui-$VERSION.war"
cd $CURR_DIR || exit
s3cmd -P put freeeedui-$VERSION.war s3://shmsoft/releases/
fi
if [ "$UPLOAD_TO_S3_FREEEED_PACK" == true ]; then
echo "Uploading to S3.... freeeed_complete_pack-$VERSION.zip"
cd $CURR_DIR || exit
s3cmd -P put freeeed_complete_pack-$VERSION.zip s3://shmsoft/releases/
fi
echo "Upload Done!"