printshopcreator/.make/01-application-setup.mk
2022-12-28 19:28:50 +01:00

19 lines
744 B
Makefile

##@ [Application: Setup]
.PHONY: setup
setup: ## Setup the application
"$(MAKE)" composer ARGS="--working-dir=/data/www/new install"
"$(MAKE)" setup-db
.PHONY: setup-db
setup-db: ## Setup the DB tables
$(DOCKER_COMPOSE) cp ./.setup $(DOCKER_SERVICE_NAME_PHP_MYSQL):/setup
$(DOCKER_COMPOSE) exec -T $(DOCKER_SERVICE_NAME_PHP_MYSQL) bash -c 'mysql --password=$$MYSQL_ROOT_PASSWORD psc < /setup/mysql/backup.sql'
$(DOCKER_COMPOSE) cp ./.setup $(DOCKER_SERVICE_NAME_PHP_MONGODB):/setup
$(DOCKER_COMPOSE) exec -T $(DOCKER_SERVICE_NAME_PHP_MONGODB) bash -c 'mongorestore /setup/mongodb/'
.PHONY: composer
composer: ## Run composer commands. Specify the command e.g. via ARGS="install"
$(EXECUTE_IN_APPLICATION_CONTAINER) composer $(ARGS);