forked from IntegriChain1/s3parq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev_env
executable file
·32 lines (27 loc) · 1 KB
/
dev_env
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
#! /bin/bash
if [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
echo '
+-----------------------------------------------------+
|Spin up a docker container for development! |
|dev_env [OPTIONS] |
| |
|options: |
|--help -h\tdisplay this message |
|--build -b\tforce rebuild the image |
+-----------------------------------------------------+
'
exit
fi
AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id)
AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key)
AWS_REGION=$(aws configure get region)
if [ "$(docker images -q s3parq:latest 2> /dev/null)" == "" ] || [ "$1" == "--build" ] || [ "$1" == "-b" ]; then
docker build . -t s3parq
fi
docker run \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-e AWS_REGION=$AWS_REGION \
-p 5432 \
-it -v \
$(pwd):/app s3parq /bin/bash