Skip to content

Commit

Permalink
Update -with-postgres command for new docker compose syntax.
Browse files Browse the repository at this point in the history
Remove obselete version key.
  • Loading branch information
rtibbles committed Jun 25, 2024
1 parent 70b4b7d commit ac4d5a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ SHELL := bash
.ONESHELL:
.PHONY: help clean clean-pyc release dist

# standalone install method
DOCKER_COMPOSE = docker-compose

# support new plugin installation for docker-compose
ifeq (, $(shell which docker-compose))
DOCKER_COMPOSE = docker compose
endif

define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
Expand Down Expand Up @@ -84,16 +92,16 @@ tox:
set -ex
function _on_interrupt() {
# leave off `-v` to skip volume cleanup for debugging error
docker-compose down
$(DOCKER_COMPOSE) down
}
trap _on_interrupt SIGINT SIGTERM SIGKILL ERR
docker-compose up --detach
until docker-compose logs --tail=1 postgres | grep -q "database system is ready to accept connections"; do
$(DOCKER_COMPOSE) up --detach
until $(DOCKER_COMPOSE) logs --tail=1 postgres | grep -q "database system is ready to accept connections"; do
echo "$(date) - waiting for postgres..."
sleep 1
done
$(MAKE) -e $(subst -with-postgres,,$@)
docker-compose down -v
$(DOCKER_COMPOSE) down -v

coverage: ## check code coverage quickly with the default Python
coverage run --source morango setup.py test
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.4'

services:
postgres:
image: postgres:9.6
Expand Down

0 comments on commit ac4d5a3

Please sign in to comment.