-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBakefile
More file actions
29 lines (26 loc) · 792 Bytes
/
Bakefile
File metadata and controls
29 lines (26 loc) · 792 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
#!/usr/bin/env bash
bake_task example "run an example"
function example () {
local example_name="${1:-}"
if [ -z "$example_name" ]; then
bake_echo_red "Available examples:"
for d in examples/*; do
echo "bake example $(basename $d)"
done
return 1
fi
python -m "examples.$example_name"
}
bake_task start.postgres "start a postgres docker container for the postgres example"
function start.postgres () {
docker kill mqcommand_postgres 2>/dev/null || :
docker run -it --rm -d \
-p "5433:5432" \
-v "$PWD/fixtures:/app/fixtures" \
--name "mqcommand_postgres" postgres:10
echo "wait for postgres to start..."
sleep 5
docker exec -it mqcommand_postgres psql \
postgres://postgres@localhost \
-f /app/fixtures/create_message_queue.sql
}