/[projects]/misc/xoa-installer/xoa-installer.sh
ViewVC logotype

Contents of /misc/xoa-installer/xoa-installer.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2980 - (show annotations) (download) (as text)
Sat Mar 19 08:19:53 2016 UTC (8 years, 2 months ago) by torben
File MIME type: application/x-sh
File size: 2072 byte(s)
also install node/bcrypt
1 #!/bin/bash
2
3
4 # npm install -g npm@next
5
6 #BRANCH=next-release
7 BRANCH=master
8
9
10 function restartxo {
11 killall -9 node
12 rm -f /root/forever.log
13 forever start -l /root/forever.log /root/xo-server/bin/xo-server
14 }
15
16 if [ "$1" == "restart" ] ; then
17 restartxo
18 exit
19 fi
20
21 if [ "$1" == "clean" ] ; then
22 echo cleaning xo-web
23 rm -rf xo-web
24
25 echo cleaning xo-server
26 rm -rf xo-server
27
28 echo cleaning .npm
29 rm -rf .npm
30
31 echo cleaning .node-gyp
32 rm -rf .node-gyp
33
34 echo cleaning .cache
35 rm -rf .cache
36
37 echo cleaning .forever
38 rm -rf .forever
39 rm -rf forever.log
40
41
42 echo done
43 exit
44 fi
45
46
47 if [ ! -x "/usr/bin/curl" ] ; then
48 echo "installing curl"
49 apt-get install curl || exit
50 fi
51
52 if [ ! -x "/usr/bin/gcc" ] ; then
53 echo "installing build-essential"
54 apt-get install build-essential || exit
55 fi
56
57 if [ ! -x "/usr/bin/redis-server" ] ; then
58 echo "installing redis-server"
59 apt-get install redis-server || exit
60 fi
61
62 if [ ! -x "/usr/bin/git" ] ; then
63 echo "installing git"
64 apt-get install git
65 fi
66
67
68 if [ ! -x "/usr/local/bin/n" ] ; then
69 echo "installing node.js bootstrap"
70 curl -o /usr/local/bin/n https://raw.githubusercontent.com/visionmedia/n/master/bin/n || exit
71 chmod +x /usr/local/bin/n
72 fi
73
74 if [ ! -x "/usr/local/bin/node" ] ; then
75 echo "installing node.js"
76 n stable || exit
77 fi
78
79 if [ ! -x "/usr/local/bin/gulp" ] ; then
80 echo "installing gulp"
81 npm install -g gulp
82 fi
83
84 if [ ! -x "/usr/local/bin/forever" ] ; then
85 echo "installing forever"
86 npm install -g forever
87 fi
88
89 if [ ! -x "/usr/local/bin/node-gyp" ] ; then
90 echo "installing node-gyp"
91 npm install -g node-gyp
92 fi
93
94 npm install -g bcrypt
95
96 if [ ! -d "xo-web" ] ; then
97 git clone -b $BRANCH https://github.com/vatesfr/xo-web.git
98 else
99 cd xo-web
100 git pull
101 cd ..
102 fi
103
104
105 if [ ! -d "xo-server" ] ; then
106 git clone -b $BRANCH https://github.com/vatesfr/xo-server.git
107 else
108 cd xo-server
109 git pull
110 cd ..
111 fi
112
113
114 # xo-server
115 echo "building xo-server"
116 cd xo-server
117 npm install || exit
118 npm run build || exit
119 cd ..
120
121
122 #xo-web
123 echo "building xo-web"
124 cd xo-web
125 npm install --unsafe-perm || exit
126 npm run build || exit
127 cd ..
128
129 restartxo

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20