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
310
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
190
Gilles, craftman from father to son
gbprod
0
110
SOLID/STUPID
gbprod
0
280
DDD: Retour d'expérience
gbprod
0
31
Artisan développeur
gbprod
0
53
Other Decks in Programming
See All in Programming
メモリ最適化を究める!iOSアプリ開発における5つの重要なポイント
yhirakawa333
0
400
令和トラベルにおけるLLM活用事例:社内ツール開発から得た学びと実践
ippo012
0
120
Prolog入門
qnighy
3
870
Jakarta EE meets AI
ivargrimstad
0
260
Rustではじめる負荷試験
skanehira
5
1.2k
実践 Advanced CallKit 〜快適な通話の実現に向けて〜
mot_techtalk
3
120
デザインシステムとコンポーネント指向によるフロントエンド開発プロセスの革新 / Innovation in Frontend Development Processes through Design Systems and Component-Oriented Architecture
nrslib
8
5.2k
ブラウザ互換の重要性 - あらゆるユーザーに価値を届けるために必要なこと
yamanoku
0
110
フロントエンドカンファレンス北海道2024 『小規模サイトでも使えるVite 〜HTMLコーディングをよりスマートに〜』長谷川広武(ハム)
h2ham
1
2.6k
LangGraphでのHuman-in-the-Loopの実装
os1ma
3
970
The Future of Frontend i18n : Intl.MessageFormat
sajikix
1
2.5k
Some more adventure of Happy Eyeballs
coe401_
2
160
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
270
40k
Typedesign – Prime Four
hannesfritz
39
2.3k
Mobile First: as difficult as doing things right
swwweet
221
8.8k
Gamification - CAS2011
davidbonilla
79
4.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
Making the Leap to Tech Lead
cromwellryan
128
8.8k
Atom: Resistance is Futile
akmur
261
25k
Building Adaptive Systems
keathley
36
2.1k
Debugging Ruby Performance
tmm1
72
12k
The Cult of Friendly URLs
andyhume
76
5.9k
Agile that works and the tools we love
rasmusluckow
327
20k
Rebuilding a faster, lazier Slack
samanthasiow
78
8.6k
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 ?