forked from usdoj-crt/crt-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·35 lines (27 loc) · 1.22 KB
/
run.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
#!/bin/bash
# used by local docker container
# # make sure migrations are applied
echo Migrating database...
python /code/crt_portal/manage.py migrate
echo Generating css...
node node_modules/gulp/bin/gulp build-sass
# If LOCALSTACK is set in environment, this will upload static files to the localstack s3 service running in docker
# Otherwise the development server is handling static files
if [[ -n "${USE_LOCALSTACK}" ]]; then
echo Removing crt-portal s3 bucket
aws --endpoint-url=${LOCALSTACK_URL} s3 rb s3://crt-portal --force
echo Creating crt-portal s3 bucket
aws --endpoint-url=${LOCALSTACK_URL} s3 mb s3://crt-portal
echo Creating crt-private s3 bucket
aws --endpoint-url=${LOCALSTACK_URL} s3 mb s3://crt-private
echo Collecting and uploading static assets to localstack...
python /code/crt_portal/manage.py collectstatic --noinput
else
# Since the dev server is handling static files, let's rebuild them as we modify
echo Watching-sass to rebuild as we make changes...
node node_modules/gulp/bin/gulp watch-sass &
fi;
echo Compiling i8n files…
python /code/crt_portal/manage.py compilemessages
echo Starting Django Server…
python /code/crt_portal/manage.py runserver 0.0.0.0:8000