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
地方に住むエンジニアの残酷な現実とキャリア論
ichimichi
5
1.3k
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
1k
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
1
400
生成AIで日々のエラー調査を進めたい
yuyaabo
0
650
Julia という言語について (FP in Julia « SIDE: F ») for 関数型まつり2025
antimon2
3
980
0626 Findy Product Manager LT Night_高田スライド_speaker deck用
mana_takada
0
110
C++20 射影変換
faithandbrave
0
530
エンジニア向け採用ピッチ資料
inusan
0
160
XP, Testing and ninja testing
m_seki
3
190
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
440
XSLTで作るBrainfuck処理系
makki_d
0
210
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
210
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Stop Working from a Prison Cell
hatefulcrawdad
270
20k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Visualization
eitanlees
146
16k
Building Adaptive Systems
keathley
43
2.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Designing Experiences People Love
moore
142
24k
Documentation Writing (for coders)
carmenintech
72
4.9k
A better future with KSS
kneath
239
17k
Unsuck your backbone
ammeep
671
58k
Embracing the Ebb and Flow
colly
86
4.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.4k
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 ?