mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-12 08:00: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 build
|
||||||
- docker-compose up -d
|
- docker-compose up -d
|
||||||
script:
|
script:
|
||||||
|
- docker-compose run --rm dbmate make wait
|
||||||
- docker-compose run --rm dbmate make test
|
- docker-compose run --rm dbmate make test
|
||||||
- docker-compose run --rm dbmate make lint
|
- docker-compose run --rm dbmate make lint
|
||||||
- docker build -t dbmate .
|
- docker build -t dbmate .
|
||||||
|
|
|
||||||
5
Makefile
5
Makefile
|
|
@ -21,6 +21,11 @@ test:
|
||||||
lint:
|
lint:
|
||||||
gometalinter.v2 $(PACKAGES)
|
gometalinter.v2 $(PACKAGES)
|
||||||
|
|
||||||
|
.PHONY: wait
|
||||||
|
wait:
|
||||||
|
dbmate -e MYSQL_URL wait
|
||||||
|
dbmate -e POSTGRESQL_URL wait
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf dist
|
rm -rf dist
|
||||||
|
|
|
||||||
|
|
@ -5,19 +5,16 @@ services:
|
||||||
context: .
|
context: .
|
||||||
target: build
|
target: build
|
||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
- mysql
|
||||||
condition: service_healthy
|
- postgres
|
||||||
postgres:
|
environment:
|
||||||
condition: service_healthy
|
MYSQL_URL: mysql://root:root@mysql/dbmate
|
||||||
|
POSTGRESQL_URL: postgres://postgres:postgres@postgres/dbmate?sslmode=disable
|
||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
image: mysql:5.7
|
image: mysql:5.7
|
||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: root
|
MYSQL_ROOT_PASSWORD: root
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "mysqladmin", "status", "-proot"]
|
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:9.6
|
image: postgres:9.6
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "pg_isready"]
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue