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

DevOps for Small Teams WavePHP 2018

Joe Ferguson
September 21, 2018

DevOps for Small Teams WavePHP 2018

DevOps is a large part of a company of any size. In the 9+ years that I have been a professional developer I have always taken an interest in DevOps and have been the "server person" for most of the teams I have been a part of. I would like to teach others how easy it is to implement modern tools to make their everyday development and development processes better. I will cover a range of topics from "Stop using WAMP/MAMP and start using Vagrant", "version control isn't renaming files", "Automate common tasks with shell scripts / command line PHP apps" and "From Vagrant to Production".

Joe Ferguson

September 21, 2018
Tweet

More Decks by Joe Ferguson

Other Decks in Technology

Transcript

  1. Who Am I? Joe Ferguson PHP Developer PHP Architect @

    Ministry Brands Twitter: @JoePFerguson OSMI Board Member Drone Racing Pilot
  2. My first “dev” job Hired to convert PSDs to HTML

    Ended up building / hacking at web apps
  3. My first “dev” job Hired to convert PSDs to HTML

    Ended up building / hacking at web apps We had no DevOps (was it even a thing then?)
  4. My first “dev” job Hired to convert PSDs to HTML

    Ended up building / hacking at web apps We had no DevOps (was it even a thing then?) We invested in metal
  5. My first “dev” job Hired to convert PSDs to HTML

    Ended up building / hacking at web apps We had no DevOps (was it even a thing then?) We invested in metal Just started using “the cloud”
  6. My second dev job Yay I'm not alone! I was

    still "the server person"
  7. Yay I'm not alone! I was still "the server person”

    Scaling a team We needed to scale up (and skill up) our team My second dev job
  8. Disable FTP Access*! # echo troy >> /etc/ftpuser # echo

    andy >> /etc/ftpuser # echo joe >> /etc/ftpuser Better yet, disable FTP completely*
  9. Vagrant allows you to: •Create a server •Configure a server

    •Delete a server …over and over and over..
  10. What’s in Homestead •Ubuntu 18.04 •PHP 5.6->7.2 •Nginx •MySQL •MariaDB

    •Sqlite3 •Postgres •Composer •Yarn •NodeJS •Bower •Grunt •Gulp •Beanstalkd •Memcached •Redis
  11. Guided path to create your own Vagrant Supports common Distributions

    Customize users, firewall rules, cron jobs Add databases, virtual hosts Supports Ruby, PHP, Python, NodeJS, HHVM Beanstalkd & RabbitMQ Elastic Search & Apache Solr PuPHPet.com
  12. Other Provisioners Shell Chef - use existing Cookbooks Docker -

    used if your app is in Docker SaltStack
  13. Scaling a team Test your code! Testing was the hardest

    part for us. The payoffs in catching regression bugs and confidence in our deployments was well worth it
  14. Is your code testable? If unit testing is hard, your

    code may not have been written to be testable.
  15. Continuous Integration Frequently integrate code changes into the existing code

    repository Merging branches to master/production Automated build tests to ensure issues found quickly Does not have to be deployed
  16. Continuous Delivery Produce valuable changes in code in short cycles

    to be released at any time. AKA: Continuous Deployment Automated build tests to ensure issues found quickly Deployment happens on successful build
  17. Which is right for you? Your goal should be Continuous

    Integration (at least!) Strive for Continuous Delivery if it makes sense Applications with a live event component may not be suited for Continuous Delivery
  18. Stop typing the same commands git status git pull origin

    master git branch —set-upstream-to=origin/master vagrant global-status | grep running redis-server /usr/local/etc/redis.conf php -S localhost:8000 ssh [email protected] -t screen -dR irc gs gpm gsu vgr startredis startphp irc
  19. Make use of aliases alias gs=“git status” alias gpm=“git pull

    origin master” alias gsu=“git branch —set-upstream-to=origin/master” alias vgr=“vagrant global-status | grep running” alias startredis=“redis-server /usr/local/etc/redis.conf” alias startphp=“php -S localhost:8000” alias irc=“ssh [email protected] -t screen -dR irc"
  20. Customize your shell • Local IPs • Date Green Text

    because this is the local machine • User • Hostname • Current Path • Current time
  21. Customize your shell • User • Hostname • Current Path

    • Current time • Local IPs • Date Red Text because this is a remote machine
  22. Automate Common Tasks Alias long commands Shell script sequential commands

    Use cron to run your scripts at specific times Create installers for your settings
  23. Recap Version Control everything you can Create a process that

    works for your team Practice how you play Test everything you can Automate everything you can