Skip to content

Commit

Permalink
fix: makefile improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
delyriand committed Apr 8, 2022
1 parent f46b553 commit 7f71be5
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.DEFAULT_GOAL := help
SHELL=/bin/bash
APP_DIR=tests/Application
SYLIUS_VERSION=1.10
SYLIUS_VERSION=1.10.0
SYMFONY=cd ${APP_DIR} && symfony
COMPOSER=symfony composer
CONSOLE=${SYMFONY} console
Expand Down Expand Up @@ -62,18 +62,21 @@ ${APP_DIR}/node_modules: yarn.install
application: .php-version php.ini ${APP_DIR} setup_application ${APP_DIR}/docker-compose.yaml

${APP_DIR}:
(${COMPOSER} create-project --prefer-dist --no-scripts --no-progress --no-install sylius/sylius-standard="${SYLIUS_VERSION}" ${APP_DIR})
(${COMPOSER} create-project --no-interaction --prefer-dist --no-scripts --no-progress --no-install sylius/sylius-standard="~${SYLIUS_VERSION}" ${APP_DIR})

setup_application:
rm -f ${APP_DIR}/yarn.lock
(cd ${APP_DIR} && ${COMPOSER} config repositories.plugin '{"type": "path", "url": "../../"}')
(cd ${APP_DIR} && ${COMPOSER} config extra.symfony.allow-contrib true)
(cd ${APP_DIR} && ${COMPOSER} config minimum-stability dev)
(cd ${APP_DIR} && ${COMPOSER} require --no-scripts --no-progress --no-install --no-update monsieurbiz/${PLUGIN_NAME}="*@dev")
$(MAKE) apply_dist
(cd ${APP_DIR} && ${COMPOSER} require --no-install --no-scripts --no-progress sylius/sylius="~${SYLIUS_VERSION}") # Make sure to install the required version of sylius because the sylius-standard has a soft constraint
$(MAKE) ${APP_DIR}/.php-version
$(MAKE) ${APP_DIR}/php.ini
(cd ${APP_DIR} && ${COMPOSER} install)
(cd ${APP_DIR} && ${COMPOSER} install --no-interaction)
$(MAKE) apply_dist
(cd ${APP_DIR} && ${COMPOSER} require --no-progress monsieurbiz/${PLUGIN_NAME}="*@dev")
rm -rf ${APP_DIR}/var/cache


${APP_DIR}/docker-compose.yaml:
rm -f ${APP_DIR}/docker-compose.yml
Expand Down Expand Up @@ -183,6 +186,11 @@ docker.logs: ## Logs the docker containers
cd ${APP_DIR} && ${COMPOSE} logs -f
.PHONY: docker.logs

docker.dc: ARGS=ps
docker.dc: ## Run docker-compose command. Use ARGS="" to pass parameters to docker-compose.
cd ${APP_DIR} && ${COMPOSE} ${ARGS}
.PHONY: docker.dc

server.start: ## Run the local webserver using Symfony
${SYMFONY} local:server:start -d

Expand Down

0 comments on commit 7f71be5

Please sign in to comment.