forked from gary-archer/oauth.websample.final
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·67 lines (58 loc) · 1.47 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
#!/bin/bash
###########################################################
# A script to build all web resources for local development
###########################################################
cd "$(dirname "${BASH_SOURCE[0]}")"
#
# Get the build configuration
#
BUILD_CONFIGURATION="$1"
if [ "$BUILD_CONFIGURATION" != 'RELEASE' ]; then
BUILD_CONFIGURATION='DEBUG'
fi
#
# Download development SSL certificates
#
./downloadcerts.sh
if [ $? -ne 0 ]; then
exit
fi
#
# Build the development web host's code
#
cd webhost
echo 'Building the web host ...'
./build.sh
if [ $? -ne 0 ]; then
echo 'Problem encountered building the development web host'
exit
fi
cd ..
#
# When connecting the SPA to a local API, build a token handler to run on the local development computer
#
if [ "$1" == 'LOCALAPI' ]; then
rm -rf localtokenhandler 2>/dev/null
git clone https://github.com/gary-archer/oauth.tokenhandler.docker localtokenhandler
if [ $? -ne 0 ]; then
echo 'Problem encountered downloading local token handler resources'
exit
fi
echo 'Building the local token handler ...'
./localtokenhandler/deployment/docker-local/build.sh
if [ $? -ne 0 ]; then
echo 'Problem encountered building local token handler resources'
exit
fi
fi
#
# Build the SPA in watch mode, so that we can develop productively and see changes
#
echo 'Building the SPA ...'
cd spa
./build.sh "$BUILD_CONFIGURATION"
if [ $? -ne 0 ]; then
echo 'Problem encountered building the SPA'
exit
fi
cd ..