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

Modern Make for modern (Rails) programmers

Modern Make for modern (Rails) programmers

F9c1a378a1e3926ea1a58cf724140000?s=128

Ivan Nemytchenko

August 05, 2021
Tweet

Transcript

  1. Modern Make for modern (RAILS) developers Ivan Nemytchenko, @inem, inem.at

    RubyConf Brasil 2020 CRASH COURSE
  2. Ivan Nemytchenko • rubyist since 2006 • former GitLabber •

    teacher • railshurts.com author • freelance/consulting
  3. • painlessrails.com

  4. http://urban-connect.ch

  5. What to expect here • What’s the problem? • The

    basics • Advanced stuff • Examples from real project • Principles
  6. Make?

  7. What’s the problem?

  8. Modern Developer? • Dev+Ops • Multiple stacks (Rails + JS

    for example) • Multiple projects • Multiple environments (dev, ±docker, ssh)
  9. Command line interface tools • git • ssh • rails

    • bundle • docker • docker-compose • heroku • aws • ansible • ansible-playbook • yarn • …
  10. Command line interface tools

  11. 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
  12. 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 Imperative, not declarative!
  13. • Imperative, not declarative • Implementation, not semantics • Have

    to remember a lot of low-level details • Outdated README-s What’s the problem?
  14. Deployment ansible-playbook -i inventory/production -- tags "deploy" app-server.yml --become- user=app

    --extra-vars=extra.txt --vault- password-file="~/.ansible/vault.txt" -vvv
  15. How about? make deploy

  16. make deploy

  17. Run tests MINITEST_REPORTER=SpecReporter bundle exec bin/rails test

  18. Make test

  19. Yay! • You can use Make now!

  20. Modern Make In practice

  21. Why not … ? • Rake • Yarn • Bash

    scripts
  22. USE Make AS GLUE BETWEEN TECHNOLOGIES!

  23. Principles • No instructions in Readme! • Semantics first! •

    Duplication is ok! • StackOverflow → Makefile
  24. Modern make http://makefile.site http://re.dopo.st/201015204327 http://inem.at