-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_env.sh
executable file
·55 lines (43 loc) · 1.14 KB
/
create_env.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
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
if [ -z "${PGUSER}" ]; then
PGUSER=dev
fi
if [ -z "${PGPASSWORD}" ]; then
PGPASSWORD=dev
fi
if [ -z "${PGPORT}" ]; then
PGPORT=5432
fi
if [ -z "${PGHOST}" ]; then
PGHOST=postgres
fi
#if [ -z "${PGDATABASE}" ]; then
#PGDATABASE=gis
#fi
#if [ -z "${DUMPPREFIX}" ]; then
#DUMPPREFIX=PG
#fi
# Now write these all to case file that can be sourced
# by then cron job - we need to do this because
# env vars passed to docker will not be available
# in then contenxt of then running cron script.
echo "
export PGUSER=$PGUSER
export PGPASSWORD=$PGPASSWORD
export PGPORT=$PGPORT
export PGHOST=$PGHOST
export PG_BACKUP_DB=$PG_BACKUP_DB
export PG_BACKUP_TABLE_OPTIONS=$PG_BACKUP_TABLE_OPTIONS
export BACKUP_BASE_DIR=$BACKUP_BASE_DIR
export AWS_ACCESS_KEY=$AWS_ACCESS_KEY
export AWS_SECRET_KEY=$AWS_SECRET_KEY
export AWS_BACKUP_DIR=$AWS_BACKUP_DIR
export AWS_SIGNURL_TIMEOUT=$AWS_SIGNURL_TIMEOUT
export SMTP_URL=$SMTP_URL
export SMTP_USER=$SMTP_USER
export SMTP_PASSWORD=$SMTP_PASSWORD
export SMTP_BACKUP_TO=$SMTP_BACKUP_TO
export SMTP_SUBJECT_PREFIX="$SMTP_SUBJECT_PREFIX"
" >> /env.sh
#export PGDATABASE=$PGDATABASE
#export DUMPPREFIX=$DUMPPREFIX