forked from monarch-initiative/monarch-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbamboo-start-server.sh
executable file
·61 lines (49 loc) · 1.44 KB
/
bamboo-start-server.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
#!/bin/sh
# ./start-server.sh [ENVNAME]
#
# ENVNAME: dev, stage, production (default is 'dev')
# Optional environment variables:
# PORT (defaults to 8080)
#
# Special ENV names:
# - CORSTest: This is the same as 'dev', but it overrides the defaultConfig.app_base
# to be http://127.0.0.1:8080, which is distinct enough from http://localhost:8080 that
# cross-origin references will occur when using Phenogrid, even though the app_base is pointing
# to the local developer server. If CORS is improperly configured in webapp.js, then these
# references should cause an error in the browser, which a developer can detect and correct.
# Currently, webapp.js is configured to accept CORS requests and respond correctly.
#
RUNENV=$1
if [ ! $RUNENV ]; then
RUNENV=dev
fi
if [ $RUNENV = dev ]; then
source /var/home/bamboo/.nvm/nvm.sh
fi
if [ $RUNENV = stage ]; then
source /home/bamboo/.nvm/nvm.sh
fi
if [ $RUNENV = production ]; then
source /home/bamboo/.nvm/nvm.sh
fi
if [ $PORT ]
then
MARGS="--port $PORT"
else
MARGS="--port 8080"
fi
nvm install v0.12.2
nvm use v0.12.2
npm install -g [email protected]
NODE_NVM_PATH=$(which node)
echo $NODE_NVM_PATH
$NODE_NVM_PATH -v
echo 'console.log("NODEVERSION:", process.version);' |$NODE_NVM_PATH
echo 'checking aliases'
alias
export NODE_PATH=./lib/monarch
export USE_BUNDLE=1
export USE_LOG_FETCH=1
$NODE_NVM_PATH ./lib/monarch/web/webapp_launcher.js $MARGS $RUNENV
echo 'Which node after start server'
which node