From c42b747e3538eb8f0ead1534c381933afdc0b87e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Wed, 23 Jan 2019 05:29:46 +0100 Subject: [PATCH] Fix mysql initialization There may be a race condition, where the mysql container is initialized without creating the root user. To address this, we wait until the right message from the mysql logs. In practice, we should do even better by running the provision.sh scripts directly inside the mysql container. This is for issues #132 and #133 --- deploy/local/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deploy/local/Makefile b/deploy/local/Makefile index a8a534b..dbf873d 100644 --- a/deploy/local/Makefile +++ b/deploy/local/Makefile @@ -59,6 +59,9 @@ databases: init-mysql provision-databases migrate provision-oauth2 ## Bootstrap init-mysql: ## Make sure that mysql is properly initialized docker-compose up -d mysql + until docker-compose logs mysql | grep "MySQL init process done. Ready for start up."; do \ + sleep 1;\ + done docker-compose stop mysql provision-databases: ## Create necessary databases and users $(DOCKER_COMPOSE_RUN) -v $(PWD)/../env/openedx/scripts:/openedx/scripts lms /openedx/scripts/provision.sh