-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-strapi.sh
executable file
·35 lines (28 loc) · 1.12 KB
/
run-strapi.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
#!/usr/bin/env bash
set -e
set -m
STRAPI_FOLDER=strapi
./clone_strapi.sh strapi master $STRAPI_FOLDER
# copy server.js with URL set
cp strapi-custom/server.js $STRAPI_FOLDER/examples/getstarted/config/server.js
# copy SSO provider bootstrap.js with CAS defaults changed for this test deployment
mkdir -p $STRAPI_FOLDER/examples/getstarted/extensions/users-permissions/config/functions
cp strapi-custom/bootstrap.js $STRAPI_FOLDER/examples/getstarted/extensions/users-permissions/config/functions
# copy over user-permissions-actions.js b/c bootstrap.js references it by relative path
cp strapi/packages/strapi-plugin-users-permissions/config/users-permissions-actions.js $STRAPI_FOLDER/examples/getstarted/extensions/users-permissions/config
cd $STRAPI_FOLDER
yarn setup
cd examples/getstarted
# run without SSL verification in order to call CAS via https
NODE_TLS_REJECT_UNAUTHORIZED=0 yarn develop &
pid=$!
if [[ "$CI" != "true" ]]; then
fg 1
else
echo "Waiting for Strapi start up"
until curl -k -L --output /dev/null --silent --fail http://localhost:1337; do
echo -n '.'
sleep 1
done
echo "Strapi Ready - PID: $pid"
fi