Modern Makeformodern (RAILS) developersIvan Nemytchenko, @inem, inem.atRubyConf Brasil 2020CRASH COURSE
View Slide
Ivan Nemytchenko• rubyist since 2006• former GitLabber• teacher• railshurts.com author• freelance/consulting
• painlessrails.com
http://urban-connect.ch
What to expect here• What’s the problem?• The basics• Advanced stuff• Examples from real project• Principles
Make?
What’s the problem?
Modern Developer?• Dev+Ops• Multiple stacks (Rails + JS for example)• Multiple projects• Multiple environments (dev, ±docker, ssh)
Command line interface tools• git• ssh• rails• bundle• docker• docker-compose• heroku• aws• ansible• ansible-playbook• yarn• …
Command line interface tools
What’s the problem?ansible-playbook -i inventory/production --tags "deploy" app-server.yml --become-user=app --extra-vars=extra.txt --vault-password-file="~/.ansible/vault.txt" -vvv
What’s the problem?ansible-playbook -i inventory/production --tags "deploy" app-server.yml --become-user=app --extra-vars=extra.txt --vault-password-file="~/.ansible/vault.txt" -vvvImperative, not declarative!
• Imperative, not declarative• Implementation, not semantics• Have to remember a lot of low-leveldetails• Outdated README-sWhat’s the problem?
Deploymentansible-playbook -i inventory/production --tags "deploy" app-server.yml --become-user=app --extra-vars=extra.txt --vault-password-file="~/.ansible/vault.txt" -vvv
How about?make deploy
make deploy
Run testsMINITEST_REPORTER=SpecReporter bundle execbin/rails test
Make test
Yay!• You can use Make now!
Modern MakeIn practice
Why not … ?• Rake• Yarn• Bash scripts
USE MakeAS GLUE BETWEENTECHNOLOGIES!
Principles• No instructions in Readme!• Semantics first!• Duplication is ok!• StackOverflow → Makefile
Modern makehttp://makefile.sitehttp://re.dopo.st/201015204327http://inem.at