-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·45 lines (40 loc) · 950 Bytes
/
run
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
44
45
#!/bin/bash
set -e
# Read environment variables from .env file in script dir (if it exists)
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
if [ -r "$SCRIPT_DIR/.env" ]; then
source "$SCRIPT_DIR/.env"
export SPOND_PASSWORD
export SPOND_CLUB_ID
export SPOND_EMAIL
export PGPASSWORD
export PGDATABASE
export PGHOST
export PGUSER
fi
# Ensure data directory is present
mkdir -p "$SCRIPT_DIR/data"
# Test if STDIN is interactive terminal
# http://tldp.org/LDP/abs/html/intandnonint.html
if [ -t 0 ]; then
# interactive
DOCKER_ARGS="-it"
else
# non-interactive
DOCKER_ARGS=""
fi
# Run container!
docker run $DOCKER_ARGS \
--rm \
--name hortenfv-member-import \
-v "$SCRIPT_DIR/data:/data" \
-e SPOND_CLUB_ID \
-e SPOND_EMAIL \
-e SPOND_PASSWORD \
-e PGHOST \
-e PGPORT \
-e PGDATABASE \
-e PGUSER \
-e PGSSLMODE \
-e PGPASSWORD \
hortenfv-member-import "$@"