-
Notifications
You must be signed in to change notification settings - Fork 0
/
start-idsvr.sh
executable file
·67 lines (59 loc) · 1.95 KB
/
start-idsvr.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
####################################################################################################
# Run the Curity Identity Server in Docker on the local computer, preconfigured for the code example
# Please ensure that the following resources are installed before running this script:
# - Docker Desktop
# - The envsubst tool (`brew install gettext` on MacOS)
#
# If you want to expose the local instance of the Curity Identity Server via ngrok, then the following
# need to also be installed:
# - ngrok
# - The jq tool (`brew install jq` on MacOS)
####################################################################################################
cd "$(dirname "${BASH_SOURCE[0]}")"
#
# By default the Curity Identity Server will use the local computer's host IP.
# Set USE_NGROK to true and a dynamic NGROK base URL will be used automatically.
#
USE_NGROK='false'
BASE_URL='https://localhost:8443'
EXAMPLE_NAME='haapi'
#
# First check prerequisites
#
if [ ! -f './license.json' ]; then
echo 'Please copy a license.json file into the root folder of the code example'
exit 1
fi
#
# Download mobile deployment resources
#
rm -rf deployment
git clone https://github.com/curityio/mobile-deployments deployment
if [ $? -ne 0 ]; then
echo 'Problem encountered downloading deployment resources'
exit 1
fi
#
# Run the deployment script to get an NGROK URL and deploy the Curity Identity Server
#
cp ./license.json deployment/resources/license.json
./deployment/start.sh "$USE_NGROK" "$BASE_URL" "$EXAMPLE_NAME"
if [ $? -ne 0 ]; then
echo 'Problem encountered deploying the Curity Identity Server'
exit 1
fi
#
# Inform the user of the Curity Identity Server URL, to be copied to configuration
#
RUNTIME_BASE_URL=$(cat './deployment/output.txt')
echo "Curity Identity Server is running at $RUNTIME_BASE_URL"
#
# If using ngrok, configure more advanced settings
#
if [ "$USE_NGROK" == 'true' ]; then
./configure-app.sh
if [ $? -ne 0 ]; then
exit 1
fi
fi