-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathbuild.sh
executable file
·97 lines (82 loc) · 1.96 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
#############################################################################################################
# Builds application components into Docker containers, then runs a child script to build security components
#############################################################################################################
#
# Ensure that we are in the folder containing this script
#
cd "$(dirname "${BASH_SOURCE[0]}")"
#
# This is for Curity developers only
#
cp ./hooks/pre-commit .git/hooks
#
# Forward the type of each component to the child script
#
OAUTH_AGENT="$1"
OAUTH_PROXY="$2"
#
# Build the SPA into Javascript bundles
#
cd spa
npm install
if [ $? -ne 0 ]; then
echo "Problem encountered installing the SPA dependencies"
exit 1
fi
npm run build
if [ $? -ne 0 ]; then
echo "Problem encountered building the SPA code"
exit 1
fi
#
# Build the Web Host, which serves static content
#
cd ../webhost
npm install
if [ $? -ne 0 ]; then
echo "Problem encountered installing the web host dependencies"
exit 1
fi
npm run build
if [ $? -ne 0 ]; then
echo "Problem encountered building the web host code"
exit 1
fi
cd ..
docker build -f webhost/Dockerfile -t webhost:1.0.0 .
if [ $? -ne 0 ]; then
echo "Problem encountered building the web host Docker file"
exit 1
fi
#
# Build the Example API, which receives JWTs
#
cd api
npm install
if [ $? -ne 0 ]; then
echo "Problem encountered installing the example API dependencies"
exit 1
fi
npm run build
if [ $? -ne 0 ]; then
echo "Problem encountered building the example API code"
exit 1
fi
docker build -f Dockerfile -t business-api:1.0.0 .
if [ $? -ne 0 ]; then
echo "Problem encountered building the example API Docker file"
exit 1
fi
cd ..
#
# Build security components using the child script
#
./deployments/build.sh $OAUTH_AGENT $OAUTH_PROXY
#
# Build security components by running the child script
#
if [ $? -ne 0 ]; then
echo 'Problem encountered building deployment resources'
exit
fi