DevOps For Small Teams

55
DevOps For Small Teams Joe Ferguson https://joind.in/13966

Transcript of DevOps For Small Teams

DevOps For Small Teams

Joe Fergusonhttps://joind.in/13966

My first “dev” job

Hired to convert PSDs to HTML

My first “dev” job

Hired to convert PSDs to

Ended up building / hacking at web apps

My first “dev” job

Hired to convert PSDs to

Ended up building / hacking at web apps

We had no DevOps (was it even a thing then?)

My first “dev” job

Hired to convert PSDs to

Ended up building / hacking at web apps

We had no DevOps (was it even a thing then?)

We invested in metal

My first “dev” job

Hired to convert PSDs to

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”

My second dev job

Yay I'm not alone!

My second dev job

Yay I'm not alone!

I was still "the server person"

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

Scaling a team

Version control is NOT renaming files

Version control EVERYTHING

Teaching our team VCS

https://try.github.io

Teaching our team VCS

https://guides.github.com

Trial & Error is ok!

Scaling a team

Stop Editing In Production!

No more edit & uploading!

Everything goes into version control!

Disable FTP Access!

# echo troy >> /etc/ftpuser

# echo andy >> /etc/ftpuser

# echo joe >> /etc/ftpuser

Better yet, disable FTP completely

Scaling a team

Development environments

MAMP, LAMP, WAMP, WAT?

Mac/Linux/Windows Apache MySQL PHP

These are all great tools

Do you deploy to MAMP/WAMP?

They why dev on it?

Catch those env bugs earlier

Remove the phrase “…It works on my machine…”

From your team

Stop using WAMP/MAMP and start using Vagrant!

Vagrant allows you to:

• Create a server• Configure a server• Delete a server

…over and over and over..

Not sure how to create a Vagrant box?

https://puphpet.com

https://puphpet.com

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

Vagrant Cookbook

https://leanpub.com/vagrantcookbook

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

Testing Resources

https://leanpub.com/grumpy-testinghttps://leanpub.com/grumpy-phpunit

http://grumpy-learning.com

Continuous Integration Continuous Delivery

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

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

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

There are a lot of CI solutions out there

ServersForHackers.com

What is your process?

Create your workflow

Optimize your time in the console

Work smarter not harder

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

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"

Use Screen for long running processes

Think of screen as a detachable window that contains your console

Bash isn’t the only shell!

http://ohmyz.sh

Uses zsh

180+ Plugins

700+ Contributors

140+ Themes

Customize your shell

• Local IPs• Date• Current time

Green Text because this is

the local machine

• User• Hostname• Current Path• Current time

Customize your shell

• User• Hostname• Current Path• Current time

• Local IPs• Date• Current time

Red Text because this is

a remote machine

Customize your shell

Tab completion on steroids

+ Git branch info because we are in a repo

.zshrc

Automate Common Tasks

Alias long commands

Shell script sequential commands

Use cron to run your scripts at specific times

Create installers for your settings

Version Control Configs

Do NOT version control your SSH keys!

Recap

Version Control everything you can

Create a process that works for you

Practice how you play

Test everything you can

Automate everything you can

Feedback!

https://joind.in/13966

Joe FergusonTwitter: @JoePFerguson

Email: [email protected]: joepferguson

Contact Info: