Automation Automation Automation

Bbf9decfbfc2ab5b450ec503749ded28?s=47 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".

Bbf9decfbfc2ab5b450ec503749ded28?s=128

Michael Heap

February 19, 2016
Tweet

Transcript

  1. Automation Automation Automation Michael Heap (@mheap) Developer at DataSift Presented

    at PHP UK, Feb 2016
  2. Me! I’m Michael I’m @mheap Developer at DataSift

  3. Automation

  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
  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
  6. None
  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
  8. What is automation?

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

  10. ./generate_stock_update.sh

  11. What is automation?

  12. Why Automate?

  13. #1 Reason

  14. #1 Reason People...

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

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

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

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

    write tests Don't run tests Don't write/read documentation
  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
  20. What other reasons?

  21. Make money with less effort

  22. Your company wants less overhead

  23. Spend more time with partner / kids /

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

    Legends
  25. Automation is about...

  26. Fear

  27. Fear costs £££

  28. Fear makes people reckless

  29. Fear leads to bad decisions

  30. Fear leads to bad productivity

  31. Automation isn't about being lazy

  32. Automation is about being efficient

  33. So, we should automate everything right?

  34. No

  35. Feel the pain

  36. Security upgrades

  37. Anything you need to see

  38. What should we automate?

  39. Everything else

  40. Deployments

  41. Reporting

  42. CRUD Generation

  43. Anything & Everything

  44. Arguments against automation

  45. “Our system is too complicated to automate”

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

  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
  48. When should we automate?

  49. A step by step guide

  50. Do it by hand (make notes)

  51. Automate the first part

  52. Automate the second part

  53. All automated

  54. Run unattended

  55. That's all 5 steps

  56. What to automate

  57. Start small

  58. Start with the whining

  59. “Deploying is too hard”

  60. $ git checkout staging $ git pull origin staging $

    git merge feature/new-awesomeness $ git push origin staging $ cap staging deploy:full
  61. Ignore it?

  62. $ deploy-staging feature/new-awesomeness

  63. $ git checkout staging $ git pull origin staging $

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

  65. Start with the whining

  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
  67. Centralised automation

  68. Enter CI!

  69. Code changes => Run tests

  70. New servers

  71. Report generation

  72. Not just for builds

  73. CI == Automation

  74. Continuous Integration

  75. Centralised Information

  76. Public Information

  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
  78. Us

  79. Us

  80. Docblocks

  81. Generators

  82. Bootstrapping

  83. Composer packages

  84. Us The box

  85. Crazy ideas

  86. DEMO TIME

  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
  88. Business buy in

  89. It's hard work

  90. Quick wins

  91. Keep it quick

  92. Developer buy in

  93. Automation is debt

  94. Error handling

  95. Idempotency

  96. Build on the shoulders of giants

  97. Triggering actions

  98. Visibility

  99. Slack

  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
  101. Available tools

  102. Vagrant/Virtualbox

  103. Openstack

  104. Puppet Chef Ansible

  105. IDEs

  106. Liquibase

  107. Jenkins / GoCD

  108. Amazon AWS

  109. Terraform

  110. Consul

  111. Bash / Python / Other

  112. Slack

  113. Final considerations

  114. Manual tasks

  115. Security

  116. Pipelines

  117. Implementation

  118. Recommended starting point

  119. In summary

  120. Thanks! I’ve been @mheap, you’ve been awesome. Please leave feedback

    on Joind.in https://joind.in/talk/265d5