-
Notifications
You must be signed in to change notification settings - Fork 122
/
run-natively.sh
executable file
·66 lines (52 loc) · 1.7 KB
/
run-natively.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
#!/bin/bash
BASEDIR=`pwd`
isNpmPackageInstalled() {
npm list --depth 1 -g $1 > /dev/null 2>&1
}
# check dependencies
if ! hash "npm" 2>/dev/null;
then
echo "npm can't be found"
exit 1
fi
# build the console
echo -n "Do you want to rebuild the console (y/N)? "
read answer
if echo "$answer" | grep -iq "^y" ;then
cd ${BASEDIR}/shim-server-ui #CMD
if ! isNpmPackageInstalled grunt-cli
then
echo Installing Grunt, you may be asked for your password to run sudo...
sudo npm install -g grunt-cli #CMD
else
echo Grunt is already installed, skipping...
fi
if ! isNpmPackageInstalled bower
then
echo Installing Bower, you may be asked for your password to run sudo...
sudo npm install -g bower #CMD
else
echo Bower is already installed, skipping...
fi
echo Installing npm dependencies...
npm install #CMD
echo Installing Bower dependencies...
bower install #CMD
echo Building the console...
grunt build #CMD
cd ${BASEDIR}/shim-server/src/main/resources #CMD
ln -sfh ../../../../shim-server-ui/docker/assets public
#CMD create a symlink called shim-server/src/main/resources/public to the Grunt output directory
fi
echo "The MongoDB hostname defaults to the setting in application.yaml. Initially the host name is 'mongo'."
echo -n "Please enter a hostname to override it, or press Enter to keep the default? "
read answer
trimmed=${answer// /}
# start the resource server
echo Starting the resource server...
cd ${BASEDIR}
if [[ ! -z "$trimmed" ]] ;then
SPRING_DATA_MONGODB_URI="mongodb://${trimmed}:27017/omh_dsu" ./gradlew shim-server:bootRun #CMD
else
./gradlew shim-server:bootRun #CMD
fi