mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-11 23:50:04 +01:00
Replace docker-compose healthchecks with wait command (#37)
This commit is contained in:
parent
ee3162c34c
commit
c5afa36962
3 changed files with 11 additions and 8 deletions
|
|
@ -9,6 +9,7 @@ install:
|
|||
- docker-compose build
|
||||
- docker-compose up -d
|
||||
script:
|
||||
- docker-compose run --rm dbmate make wait
|
||||
- docker-compose run --rm dbmate make test
|
||||
- docker-compose run --rm dbmate make lint
|
||||
- docker build -t dbmate .
|
||||
|
|
|
|||
5
Makefile
5
Makefile
|
|
@ -21,6 +21,11 @@ test:
|
|||
lint:
|
||||
gometalinter.v2 $(PACKAGES)
|
||||
|
||||
.PHONY: wait
|
||||
wait:
|
||||
dbmate -e MYSQL_URL wait
|
||||
dbmate -e POSTGRESQL_URL wait
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf dist
|
||||
|
|
|
|||
|
|
@ -5,19 +5,16 @@ services:
|
|||
context: .
|
||||
target: build
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
- mysql
|
||||
- postgres
|
||||
environment:
|
||||
MYSQL_URL: mysql://root:root@mysql/dbmate
|
||||
POSTGRESQL_URL: postgres://postgres:postgres@postgres/dbmate?sslmode=disable
|
||||
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "status", "-proot"]
|
||||
|
||||
postgres:
|
||||
image: postgres:9.6
|
||||
healthcheck:
|
||||
test: ["CMD", "pg_isready"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue