Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Make task runners great again

GBProd
June 12, 2017

Make task runners great again

GBProd

June 12, 2017
Tweet

More Decks by GBProd

Other Decks in Programming

Transcript

  1. ENV ?= dev vendor: composer.lock ifeq ($(ENV), prod) composer install

    --no-dev --optimize-autoloader else composer install endif
  2. ENV ?= dev COMPOSER_ARGS ?= ifeq ($(ENV), prod) COMPOSER_ARGS= --no-dev

    --optimize-autoloader endif vendor: composer.lock composer install $(COMPOSER_ARGS)
  3. .env: @if [ ! -e .env ]; then \ cp

    env.dist .env; \ fi include .env
  4. clean: $(call execute, \ chmod -R 0777 var && \

    rm -Rf var/cache/prod && \ rm -Rf var/cache/dev \ )
  5. .PHONY: install install: $(MAKE) -directory=app-php install $(MAKE) -directory=app-js install $(MAKE)

    -C app-ologies install $(MAKE) -C app-artement install $(MAKE) -C app-toum install $(MAKE) -C app-app-app install
  6. .PHONY: install install: $(MAKE) -directory=app-php install $(MAKE) -directory=app-js install $(MAKE)

    -C app-ologies install $(MAKE) -C app-artement install $(MAKE) -C app-toum install $(MAKE) -C app-app-app install
  7. help: ## This help @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(TARGETS) |

    sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
  8. help: ## This help @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(TARGETS) |

    sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' https://marmelab.com/blog/2016/02/29/au to-documented-makefile.html
  9. $ make help install Install app undate Update app test-unit

    Unit test app minify Minify js/css serve Run server ...