-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
31 lines (22 loc) · 1009 Bytes
/
Makefile
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
.PHONY: build-pgcli build-psql build publish
build-pgcli:
docker build -t kyokley/pgcli -f pgcli/Dockerfile .
build-psql:
docker build -t kyokley/psql -f psql/Dockerfile .
build: build-pgcli build-psql
publish: build
docker push kyokley/pgcli
docker push kyokley/psql
test-setup:
docker-compose -f tests/docker-compose.yml up -d postgres
sleep 1
docker-compose -f tests/docker-compose.yml exec -T postgres /bin/bash -c 'psql -U postgres -f /app/setup.sql'
test-down:
docker-compose -f tests/docker-compose.yml down -v
test-pgcli: build-pgcli
docker-compose -f tests/docker-compose.yml up -d pgcli
docker-compose -f tests/docker-compose.yml exec -T pgcli /bin/sh -c 'echo "SELECT * FROM accounts;" | pgcli -h postgres -U postgres'
test-psql: build-psql
docker-compose -f tests/docker-compose.yml up -d psql
docker-compose -f tests/docker-compose.yml exec -T psql /bin/sh -c 'echo "SELECT * FROM accounts;" | psql -h postgres -U postgres'
tests: test-setup test-psql test-pgcli test-down