-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·42 lines (33 loc) · 809 Bytes
/
test.sh
File metadata and controls
executable file
·42 lines (33 loc) · 809 Bytes
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
#!/usr/bin/env bash
set -eof pipefail
puts-step() {
echo "-----> $@"
}
puts-error() {
echo "!!! $@"
}
kill-container() {
puts-step "destroying container $1"
docker rm -f "$1"
}
create-postgres-creds() {
puts-step "creating fake postgres credentials"
# create fake postgres credentials
mkdir -p $CURRENT_DIR/tmp/creds
echo "testuser" > $CURRENT_DIR/tmp/creds/user
echo "icanttellyou" > $CURRENT_DIR/tmp/creds/password
}
start-postgres() {
PG_JOB=$($1)
# wait for postgres to boot
puts-step "sleeping for 90s while postgres is booting..."
sleep 90s
}
check-postgres() {
# display logs for debugging purposes
puts-step "displaying postgres logs"
docker logs $1
# check if postgres is running
puts-step "checking if postgres is running"
docker exec $1 is_running
}