Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Make task runners great again
Search
GBProd
June 12, 2017
Programming
2
320
Make task runners great again
GBProd
June 12, 2017
Tweet
Share
More Decks by GBProd
See All by GBProd
Les tests en Symfony
gbprod
0
220
Gilles, craftman from father to son
gbprod
0
140
SOLID/STUPID
gbprod
0
330
DDD: Retour d'expérience
gbprod
0
39
Artisan développeur
gbprod
0
59
Other Decks in Programming
See All in Programming
プロダクト志向ってなんなんだろうね
righttouch
PRO
0
160
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
430
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
440
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
250
都市をデータで見るってこういうこと PLATEAU属性情報入門
nokonoko1203
1
570
ReadMoreTextView
fornewid
1
480
なぜ「共通化」を考え、失敗を繰り返すのか
rinchoku
1
530
今ならAmazon ECSのサービス間通信をどう選ぶか / Selection of ECS Interservice Communication 2025
tkikuc
20
3.6k
ruby.wasmで多人数リアルタイム通信ゲームを作ろう
lnit
2
270
アンドパッドの Go 勉強会「 gopher 会」とその内容の紹介
andpad
0
260
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
170
AIコーディング道場勉強会#2 君(エンジニア)たちはどう生きるか
misakiotb
1
250
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
299
21k
How to Ace a Technical Interview
jacobian
277
23k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.4k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Side Projects
sachag
455
42k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
5
210
A Tale of Four Properties
chriscoyier
160
23k
GraphQLとの向き合い方2022年版
quramy
48
14k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
Transcript
MAKE TASK RUNNER GREAT AGAIN @GillesRoustan
BASH PHING COMPOSER ROBO BLDR GRUMPHP NPM GULP GRUNT... @GillesRoustan
None
MAKE ONE TOOL TO RULE THEM ALL @GillesRoustan
INDEPENDANT
HOW-TO ? @GillesRoustan
# Makefile target:[prerequisites] [recipe]
# Makefile target:[prerequisites] \t [recipe]
$ make target
MAKE IS NOT A TASK RUNNER
file.o: file.c gcc file.c -o file.o
.PHONY: install install: file.o file.o: file.c gcc file.c -o file.o
$ make install gcc file.c -o file.o ...
$ make install Rien à faire pour la règle ...
MAKE ME UP, BEFORE YOU GO GO @GillesRoustan
vendor: composer.lock composer install composer.lock: composer.json composer update
.PHONY: install install: vendor [...]
$ make install composer install ...
$ make --always-make install composer update ...
.PHONY: install update update: $(MAKE) --always-make install install: vendor
MAKE CONFIGURATION @GillesRoustan
ENV = dev
ENV ?= dev
ENV ?= dev vendor: composer.lock ifeq ($(ENV), prod) composer install
--no-dev --optimize-autoloader else composer install endif
$ make install composer install ...
$ make install ENV=prod composer install --no-dev --optimize-autoloader ...
GREATER ? @GillesRoustan
ENV ?= dev COMPOSER_ARGS ?= ifeq ($(ENV), prod) COMPOSER_ARGS= --no-dev
--optimize-autoloader endif vendor: composer.lock composer install $(COMPOSER_ARGS)
INCLUDE EH MAKE, ELLE EST OÙ MA CAISSE ? @GillesRoustan
include *.mk
include .env
https://github.com/symfony/dotenv
.env: @if [ ! -e .env ]; then \ cp
env.dist .env; \ fi include .env
MAKE CONTINOUS INTEGRATION GREAT AGAIN @GillesRoustan
test-unit: install vendor/bin/phpunit $(PHPUNIT_ARGS)
# .travis.yml sudo: required services: - docker script: - make
test-unit
MAKE IT WITH DOCKER @GillesRoustan
test-unit: install docker exec -it my-container vendor/bin/phpunit
EXEC=docker exec -it my-container test-unit: install $(EXEC) vendor/bin/phpunit
MAKE FUNCTIONS ? @GillesRoustan
test-unit: install $(call execute, vendor/bin/phpunit) define execute docker exec -it
my-container $(1) @echo $(1) >> make.log endef
DOCKER EST UN ENVIRONNEMENT
# .env ENV=dev DOCKER=true
ifeq ($(DOCKER), true) define execute docker exec -it my-container $(1)
endef else define execute $(1) endef endif
clean: $(call execute, \ chmod -R 0777 var && \
rm -Rf var/cache/prod && \ rm -Rf var/cache/dev \ )
MAKE MONO-REPOSITORY @GillesRoustan
.PHONY: install install: $(MAKE) --directory=app-php install
.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
.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
MAKE MONO-REPOSITORY EASY ! @GillesRoustan
DIRS:=$(dir $(wildcard */)) .PHONY: install $(DIRS) install: $(DIRS) test-unit: $(DIRS)
$(DIRS): $(MAKE) --directory=$@ $(MAKECMDGOALS)
MAKE I HELP YOU ? @GillesRoustan
help: ## This help @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(TARGETS) |
sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
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
$ make help install Install app undate Update app test-unit
Unit test app minify Minify js/css serve Run server ...
ADOPTE UN MAKE
https://github.com/gbprod/conf-makefile
THANK YOU QUESTIONS ?