7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-01 13:50:47 +00:00

Fix infinite wait on mysql init

After mysql has already been initialized, the data/mysql/mysql folder
exists and it is no longer necessary to re-initialize it. In fact, if
this folder exists, we mus tnot wait for the "MySQL init process done"
message, which never comes up.

See
c0454b9e0e/5.6/docker-entrypoint.sh

Close #136.
This commit is contained in:
Régis Behmo 2019-01-27 14:46:22 +01:00
parent dc0f8a6c69
commit 39e2c92374

View File

@ -58,11 +58,14 @@ env: ## Generate the environment from templates and configuration values
databases: init-mysql provision-databases migrate provision-oauth2 ## Bootstrap databases
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
@(stat ../../data/mysql/mysql 1> /dev/null 2>&1 && echo "MySQL has already been initialized") || (\
echo "Waiting for mysql initialization..." \
&& 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
provision-oauth2: ## Create users for SSO between services