forked from AlexsLemonade/refinebio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_janitor.sh
executable file
·36 lines (29 loc) · 1017 Bytes
/
run_janitor.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
#!/bin/bash
# the directory it lives in.
script_directory=`perl -e 'use File::Basename;
use Cwd "abs_path";
print dirname(abs_path(@ARGV[0]));' -- "$0"`
cd $script_directory
# However in order to give Docker access to all the code we have to
# move up a level
cd ..
./prepare_image.sh -i smasher
image_name="ccdlstaging/dr_smasher"
volume_directory="$script_directory/volume"
source common.sh
HOST_IP=$(get_ip_address)
DB_HOST_IP=$(get_docker_db_ip_address)
export AWS_ACCESS_KEY_ID=`~/bin/aws configure get default.aws_access_key_id`
export AWS_SECRET_ACCESS_KEY=`~/bin/aws configure get default.aws_secret_access_key`
docker run \
-it \
-m 500m \
--add-host=database:$DB_HOST_IP \
--add-host=nomad:$HOST_IP \
--env-file workers/environments/local \
--env AWS_ACCESS_KEY_ID \
--env AWS_SECRET_ACCESS_KEY \
--entrypoint ./manage.py \
--volume $volume_directory:/home/user/data_store \
--link drdb:postgres \
$image_name run_janitor