forked from firekylin/firekylin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
68 lines (49 loc) · 1.55 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
#!/bin/sh
rm -rf firekylin;
rm -rf output;
rm -rf output.theme;
mkdir output;
echo 'webpack start ...';
npm run webpack.build.production;
echo 'webpack end';
node stc.config.js;
mkdir -p www/theme/firekylin.build/html;
cp -r www/theme/firekylin/*.html www/theme/firekylin.build/html/
cp -r www/theme/firekylin/inc www/theme/firekylin.build/html/
cp -r www/theme/firekylin/package.json www/theme/firekylin.build/html/
node stc.view.config.js;
cp -r output.theme/www/theme/firekylin.build/html/* output.theme/www/theme/firekylin;
rm -rf output.theme/www/theme/firekylin.build;
cp -r output.theme/www/ output/www/
rm -rf output.theme;
rm -rf www/theme/firekylin.build/;
npm run compile;
npm run copy-package;
cp -r app output;
rm -rf output/app/common/runtime;
cp -r nginx.conf output/nginx_default.conf;
cp -r pm2.json output/pm2_default.json;
cp -r www/*.js output/www;
cp -r db/firekylin.sql output/;
if [ 0 -eq `grep -c analyze_code output/firekylin.sql` ];then
echo 'missing analyze_code in firekylin.sql';
exit;
fi
cp -r auto_build.sh output/;
cp -r https.js output/;
cp -r https.sh output/;
rm -r output/app/common/config/db.js;
rm -rf output/www/static/js/*.map;
mv output firekylin;
VERSION=`cat .version`;
TARNAME=firekylin_${VERSION}.tar.gz;
tar zcf $TARNAME firekylin/;
mv $TARNAME build;
rm -rf firekylin/;
cd build;
tar zxvfm $TARNAME;
HOST="[email protected]";
REMOTE_TAR="/var/www/firekylin.org/www/release";
scp $TARNAME $HOST:$REMOTE_TAR;
ssh $HOST cp $REMOTE_TAR/$TARNAME $REMOTE_TAR/latest.tar.gz;
ssh $HOST "echo $VERSION > $REMOTE_TAR/.latest";