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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2978 - (hide annotations) (download) (as text)
Fri Mar 18 21:19:45 2016 UTC (8 years, 2 months ago) by torben
File MIME type: application/x-sh
File size: 1947 byte(s)
also make sure git is available
1 torben 2956 #!/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 torben 2957
47 torben 2958 if [ ! -x "/usr/bin/curl" ] ; then
48     echo "installing curl"
49     apt-get install curl || exit
50     fi
51    
52 torben 2961 if [ ! -x "/usr/bin/gcc" ] ; then
53     echo "installing build-essential"
54     apt-get install build-essential || exit
55     fi
56 torben 2962
57     if [ ! -x "/usr/bin/redis-server" ] ; then
58     echo "installing redis-server"
59     apt-get install redis-server || exit
60     fi
61 torben 2961
62    
63 torben 2957 if [ ! -x "/usr/local/bin/n" ] ; then
64     echo "installing node.js bootstrap"
65     curl -o /usr/local/bin/n https://raw.githubusercontent.com/visionmedia/n/master/bin/n || exit
66     chmod +x /usr/local/bin/n
67     fi
68    
69     if [ ! -x "/usr/local/bin/node" ] ; then
70     echo "installing node.js"
71 torben 2958 n stable || exit
72 torben 2957 fi
73    
74 torben 2959 if [ ! -x "/usr/local/bin/gulp" ] ; then
75     echo "installing gulp"
76 torben 2960 npm install -g gulp
77 torben 2959 fi
78 torben 2957
79 torben 2963 if [ ! -x "/usr/local/bin/forever" ] ; then
80     echo "installing forever"
81     npm install -g forever
82     fi
83 torben 2957
84 torben 2978 if [ ! -x "/usr/bin/git" ] ; then
85     echo "installing git"
86     apt-get install git
87     fi
88 torben 2959
89 torben 2956 if [ ! -d "xo-web" ] ; then
90     git clone -b $BRANCH https://github.com/vatesfr/xo-web.git
91     else
92     cd xo-web
93     git pull
94     cd ..
95     fi
96    
97    
98     if [ ! -d "xo-server" ] ; then
99     git clone -b $BRANCH https://github.com/vatesfr/xo-server.git
100     else
101     cd xo-server
102     git pull
103     cd ..
104     fi
105    
106    
107     # xo-server
108 torben 2959 echo "building xo-server"
109 torben 2956 cd xo-server
110 torben 2959 npm install || exit
111 torben 2956 npm run build || exit
112     cd ..
113    
114    
115     #xo-web
116 torben 2959 echo "building xo-web"
117 torben 2956 cd xo-web
118     npm install --unsafe-perm || exit
119     npm run build || exit
120     cd ..
121    
122     restartxo

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20