-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathrun_management_command.sh
executable file
·43 lines (34 loc) · 1.13 KB
/
run_management_command.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
#!/bin/sh
# Script for running the Data Refinery Surveyor container.
# This script should always run as if it were being called from
# the directory it lives in.
script_directory="$(
cd "$(dirname "$0")" || exit
pwd
)"
cd "$script_directory" || exit
# However, in order to give Docker access to all the code we have to
# move up a level
cd ..
# Set up the data volume directory if it does not already exist
volume_directory="$script_directory/volume"
if [ ! -d "$volume_directory" ]; then
mkdir "$volume_directory"
fi
chmod -R a+rwX "$volume_directory"
. ./scripts/common.sh
./scripts/prepare_image.sh -i base -s common
./scripts/prepare_image.sh -i foreman -s foreman
. ./scripts/common.sh
DB_HOST_IP=$(get_docker_db_ip_address)
docker run \
--add-host=database:"$DB_HOST_IP" \
--env AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" \
--env AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" \
--env-file foreman/environments/local \
--interactive \
--platform linux/amd64 \
--tty \
--volume "$volume_directory":/home/user/data_store \
"$DOCKERHUB_REPO/dr_foreman:$SYSTEM_VERSION" \
python3 manage.py "$@"