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

Automation Automation Automation

Michael Heap
February 19, 2016

Automation Automation Automation

A good rule of thumb to have as a developer is that if you have to do something three times or more, you should automate it. Imagine that a task takes you a minute to do, twice a day. Now imagine that you could write something that does it for you, but it would take an hour. Initially, you'll have lost an hour, but after the first month you'll be breaking even, as you've saved those two minutes per day. Then after the second month, you've essentially gained a free hour. Automation is a developer's best friend. Some things are easier to automate than others, but almost anything can be automated. In this talk, we'll take a look at what can be automated, what tools are available to help us and crucially, *if* we should automate it. Surprisingly, sometimes the answer to the question "should we?" is "no".

Michael Heap

February 19, 2016
Tweet

More Decks by Michael Heap

Other Decks in Technology

Transcript

  1. Automation Automation Automation
    Michael Heap (@mheap)
    Developer at DataSift
    Presented at PHP UK, Feb 2016

    View Slide

  2. Me!
    I’m Michael
    I’m @mheap
    Developer at DataSift

    View Slide

  3. Automation

    View Slide

  4. 1. What is automation?
    2. A step by step guide to automation
    3. Making it institutionalised
    4. Thinking outside the box
    5. I'm convinced! Let's automate
    6. Useful tools

    View Slide

  5. 0. XKCD
    1. What is automation?
    2. A step by step guide to automation
    3. Making it institutionalised
    4. Thinking outside the box
    5. I'm convinced! Let's automate
    6. Useful tools

    View Slide

  6. View Slide

  7. 1. What is automation?
    2. A step by step guide to automation
    3. Making it institutionalised
    4. Thinking outside the box
    5. I'm convinced! Let's automate
    6. Useful tools

    View Slide

  8. What is automation?

    View Slide

  9. ./scr_u -v -S 1024 -t -d /tmp

    View Slide

  10. ./generate_stock_update.sh

    View Slide

  11. What is automation?

    View Slide

  12. Why Automate?

    View Slide

  13. #1 Reason

    View Slide

  14. #1 Reason
    People...

    View Slide

  15. #1 Reason
    People...
    Have good intentions, but no time

    View Slide

  16. #1 Reason
    People...
    Have good intentions, but no time
    Don't write tests

    View Slide

  17. #1 Reason
    People...
    Have good intentions, but no time
    Don't write tests
    Don't run tests

    View Slide

  18. #1 Reason
    People...
    Have good intentions, but no time
    Don't write tests
    Don't run tests
    Don't write/read documentation

    View Slide

  19. #1 Reason
    People...
    Have good intentions, but no time
    Don't write tests
    Don't run tests
    Don't write/read documentation
    Are not deterministic

    View Slide

  20. What other reasons?

    View Slide

  21. Make money with
    less effort

    View Slide

  22. Your company wants
    less overhead

    View Slide

  23. Spend more
    time with
    partner / kids /

    View Slide

  24. Spend more
    time with
    partner / kids /
    League of Legends

    View Slide

  25. Automation
    is about...

    View Slide

  26. Fear

    View Slide

  27. Fear costs £££

    View Slide

  28. Fear makes people
    reckless

    View Slide

  29. Fear leads to
    bad decisions

    View Slide

  30. Fear leads to
    bad productivity

    View Slide

  31. Automation
    isn't about being
    lazy

    View Slide

  32. Automation
    is about being
    efficient

    View Slide

  33. So, we should
    automate
    everything right?

    View Slide

  34. No

    View Slide

  35. Feel the pain

    View Slide

  36. Security upgrades

    View Slide

  37. Anything you
    need to see

    View Slide

  38. What should
    we automate?

    View Slide

  39. Everything else

    View Slide

  40. Deployments

    View Slide

  41. Reporting

    View Slide

  42. CRUD
    Generation

    View Slide

  43. Anything
    &
    Everything

    View Slide

  44. Arguments
    against
    automation

    View Slide

  45. “Our system is too
    complicated to automate”

    View Slide

  46. “We don't have time
    to automate”

    View Slide

  47. 1. What is automation?
    2. A step by step guide to automation
    3. Making it institutionalised
    4. Thinking outside the box
    5. I'm convinced! Let's automate
    6. Useful tools

    View Slide

  48. When should
    we automate?

    View Slide

  49. A step by
    step guide

    View Slide

  50. Do it by hand
    (make notes)

    View Slide

  51. Automate the
    first part

    View Slide

  52. Automate the
    second part

    View Slide

  53. All automated

    View Slide

  54. Run unattended

    View Slide

  55. That's all
    5 steps

    View Slide

  56. What to automate

    View Slide

  57. Start small

    View Slide

  58. Start with the whining

    View Slide

  59. “Deploying is too hard”

    View Slide

  60. $ git checkout staging
    $ git pull origin staging
    $ git merge feature/new-awesomeness
    $ git push origin staging
    $ cap staging deploy:full

    View Slide

  61. Ignore it?

    View Slide

  62. $ deploy-staging feature/new-awesomeness

    View Slide

  63. $ git checkout staging
    $ git pull origin staging
    $ git merge feature/new-awesomeness
    $ git push origin staging
    $ cap staging deploy:full

    View Slide

  64. $ deploy-staging feature/new-awesomeness

    View Slide

  65. Start with the whining

    View Slide

  66. 1. What is automation?
    2. A step by step guide to automation
    3. Making it institutionalised
    4. Thinking outside the box
    5. I'm convinced! Let's automate
    6. Useful tools

    View Slide

  67. Centralised
    automation

    View Slide

  68. Enter CI!

    View Slide

  69. Code changes
    => Run tests

    View Slide

  70. New servers

    View Slide

  71. Report generation

    View Slide

  72. Not just for builds

    View Slide

  73. CI == Automation

    View Slide

  74. Continuous
    Integration

    View Slide

  75. Centralised
    Information

    View Slide

  76. Public
    Information

    View Slide

  77. 1. What is automation?
    2. A step by step guide to automation
    3. Making it institutionalised
    4. Thinking outside the box
    5. I'm convinced! Let's automate
    6. Useful tools

    View Slide

  78. Us

    View Slide

  79. Us

    View Slide

  80. Docblocks

    View Slide

  81. Generators

    View Slide

  82. Bootstrapping

    View Slide

  83. Composer
    packages

    View Slide

  84. Us
    The box

    View Slide

  85. Crazy ideas

    View Slide

  86. DEMO TIME

    View Slide

  87. 1. What is automation?
    2. A step by step guide to automation
    3. Making it institutionalised
    4. Thinking outside the box
    5. I'm convinced! Let's automate
    6. Useful tools

    View Slide

  88. Business buy in

    View Slide

  89. It's hard work

    View Slide

  90. Quick wins

    View Slide

  91. Keep it quick

    View Slide

  92. Developer buy in

    View Slide

  93. Automation is debt

    View Slide

  94. Error handling

    View Slide

  95. Idempotency

    View Slide

  96. Build on the
    shoulders of giants

    View Slide

  97. Triggering actions

    View Slide

  98. Visibility

    View Slide

  99. Slack

    View Slide

  100. 1. What is automation?
    2. A step by step guide to automation
    3. Making it institutionalised
    4. Thinking outside the box
    5. I'm convinced! Let's automate
    6. Useful tools

    View Slide

  101. Available tools

    View Slide

  102. Vagrant/Virtualbox

    View Slide

  103. Openstack

    View Slide

  104. Puppet
    Chef
    Ansible

    View Slide

  105. IDEs

    View Slide

  106. Liquibase

    View Slide

  107. Jenkins / GoCD

    View Slide

  108. Amazon AWS

    View Slide

  109. Terraform

    View Slide

  110. Consul

    View Slide

  111. Bash / Python / Other

    View Slide

  112. Slack

    View Slide

  113. Final considerations

    View Slide

  114. Manual tasks

    View Slide

  115. Security

    View Slide

  116. Pipelines

    View Slide

  117. Implementation

    View Slide

  118. Recommended
    starting point

    View Slide

  119. In summary

    View Slide

  120. Thanks!
    I’ve been @mheap, you’ve been awesome.
    Please leave feedback on Joind.in
    https://joind.in/talk/265d5

    View Slide