Midwest PHP 2017 DevOps For Small team
-
Upload
joe-ferguson -
Category
Engineering
-
view
62 -
download
0
Transcript of Midwest PHP 2017 DevOps For Small team
![Page 1: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/1.jpg)
DevOps For Small TeamsJoe Ferguson
https://joind.in/talk/edcc1
![Page 2: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/2.jpg)
Who Am I?Joe Ferguson
PHP Developer
Engineer @ Aol.
Twitter: @JoePFerguson
Organizer of @MemphisPHP
OSMI Board Member
@NomadPHP Lightning Talks
Passionate about Community
![Page 3: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/3.jpg)
My first “dev” job
Hired to convert PSDs to HTML
![Page 4: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/4.jpg)
My first “dev” job
Hired to convert PSDs to HTML
Ended up building / hacking at web apps
![Page 5: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/5.jpg)
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?)
![Page 6: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/6.jpg)
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
![Page 7: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/7.jpg)
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”
![Page 8: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/8.jpg)
My second dev job
Yay I'm not alone!
![Page 9: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/9.jpg)
My second dev job
Yay I'm not alone!
I was still "the server person"
![Page 10: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/10.jpg)
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
![Page 11: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/11.jpg)
Scaling a team
Version control is NOT renaming files
Version control EVERYTHING
![Page 16: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/16.jpg)
Trial & Error is ok!
![Page 17: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/17.jpg)
Scaling a team
Stop Editing In Production!
![Page 18: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/18.jpg)
No more edit &
uploading!
Everything goes into
version control!
![Page 19: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/19.jpg)
Disable FTP Access*!
# echo troy >> /etc/ftpuser
# echo andy >> /etc/ftpuser
# echo joe >> /etc/ftpuser
Better yet, disable FTP completely*
![Page 20: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/20.jpg)
*If you can
![Page 21: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/21.jpg)
Scaling a team
Development environments
![Page 22: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/22.jpg)
MAMP, LAMP, WAMP, WAT?
Mac/Linux/Windows Apache MySQL PHP
These are all great tools
![Page 23: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/23.jpg)
Do you deploy to MAMP/WAMP?
![Page 24: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/24.jpg)
Why develop on a different configuration?
![Page 25: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/25.jpg)
Catch those environment bugs earlier
![Page 26: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/26.jpg)
Remove the phrase “…It works on my machine…”
From your team
![Page 27: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/27.jpg)
Or learn the phrase “We’re putting your
machine into production”
![Page 28: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/28.jpg)
Stop using WAMP/MAMP and start using Vagrant!
![Page 29: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/29.jpg)
Virtualbox
VMware Fusion & Desktop
Parallels Desktop
Virtual Machine Providers
![Page 30: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/30.jpg)
API Magic
![Page 31: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/31.jpg)
Runs Anywhere (almost)
![Page 32: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/32.jpg)
Vagrant allows you to:
• Create a server• Configure a server• Delete a server
…over and over and over..
![Page 33: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/33.jpg)
What’s a box?
![Page 34: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/34.jpg)
Not sure how to create a Vagrant box?
![Page 35: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/35.jpg)
![Page 36: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/36.jpg)
![Page 37: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/37.jpg)
What’s in Homestead
•Ubuntu 16.04•PHP 7.1•Nginx•MySQL•MariaDB•Sqlite3•Postgres•Composer
•Yarn•NodeJS•Bower•Grunt•Gulp•Beanstalkd•Memcached•Redis
![Page 38: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/38.jpg)
What if Homestead doesn’t fit your application?
![Page 39: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/39.jpg)
PuPHPet.com
![Page 40: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/40.jpg)
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
![Page 41: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/41.jpg)
PuPHPet.com
Great for learning HOW to build boxes
Especially useful if you’d like to learn Puppet
![Page 42: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/42.jpg)
Other Provisioners
Shell
Chef - use existing Cookbooks
Docker - used if your app is in Docker
SaltStack
![Page 43: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/43.jpg)
Vagrant Cookbook
https://leanpub.com/vagrantcookbook
![Page 44: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/44.jpg)
Ansible for DevOps
https://leanpub.com/ansible-for-devops
![Page 45: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/45.jpg)
Vagrant is so 2013! CONTAINERS!
![Page 47: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/47.jpg)
Docker For Developers
https://leanpub.com/dockerfordevs
![Page 48: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/48.jpg)
Learning Budget
![Page 49: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/49.jpg)
Learning Budget
![Page 50: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/50.jpg)
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
![Page 51: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/51.jpg)
Is your code testable?
If unit testing is hard, your code may not have been written to be testable.
![Page 52: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/52.jpg)
Testing Resources
http://grumpy-learning.com
![Page 53: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/53.jpg)
Testing Resources
https://laracasts.com/skills/testing
![Page 54: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/54.jpg)
Continuous Integration Continuous Delivery
![Page 55: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/55.jpg)
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
![Page 56: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/56.jpg)
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
![Page 57: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/57.jpg)
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
![Page 58: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/58.jpg)
ServersForHackers.com
![Page 59: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/59.jpg)
There are a lot of CI solutions out there
![Page 60: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/60.jpg)
Getting CI Working
https://twitter.com/sebdedeyne/status/842011393364791296
![Page 61: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/61.jpg)
What is your process?
![Page 62: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/62.jpg)
Create your workflow
![Page 63: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/63.jpg)
Optimize your time in the console
![Page 64: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/64.jpg)
Work smarter not harder
![Page 65: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/65.jpg)
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
![Page 66: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/66.jpg)
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"
![Page 67: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/67.jpg)
Use Screen for long running processes
https://www.mattcutts.com/blog/a-quick-tutorial-on-screen/
![Page 68: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/68.jpg)
Think of screen as a detachable window that contains your console
![Page 69: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/69.jpg)
Screen Demo
![Page 70: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/70.jpg)
Want more Power?
https://tmux.github.io
![Page 71: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/71.jpg)
Bash isn’t the only shell!
![Page 72: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/72.jpg)
http://ohmyz.sh
Uses zsh
180+ Plugins
700+ Contributors
140+ Themes
![Page 73: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/73.jpg)
Customize your shell
• Local IPs• Date
Green Text because this is
the local machine
• User• Hostname• Current Path• Current time
![Page 74: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/74.jpg)
Customize your shell
• User• Hostname• Current Path• Current time
• Local IPs• Date
Red Text because this is
a remote machine
![Page 75: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/75.jpg)
Customize your shell
Tab completion on steroids
+ Git branch info because we are in a repo
![Page 76: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/76.jpg)
Tab Completion Demo
![Page 77: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/77.jpg)
.zshrc
![Page 78: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/78.jpg)
Automate Common Tasks
Alias long commands
Shell script sequential commands
Use cron to run your scripts at specific times
Create installers for your settings
![Page 79: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/79.jpg)
Version Control Configs
![Page 80: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/80.jpg)
Do NOT version control your SSH keys!
![Page 81: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/81.jpg)
Do NOT version control your API keys!
![Page 82: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/82.jpg)
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
![Page 83: Midwest PHP 2017 DevOps For Small team](https://reader030.fdocuments.in/reader030/viewer/2022013004/58e499cc1a28abf5428b4c0b/html5/thumbnails/83.jpg)
Feedback!
https://joind.in/talk/edcc1
Joe FergusonTwitter: @JoePFergusonEmail: [email protected]: joepferguson
Contact Info: