28
VersionEEring Why and how to use version control with ExpressionEngine.

VersionEEring

Embed Size (px)

DESCRIPTION

Why and how to use version control with an ExpressionEngine website. Version control is essential to good development practices, but setting it up with a database-driven website can be tricky.

Citation preview

Page 1: VersionEEring

VersionEEringWhy and how to use versioncontrol with ExpressionEngine.

Page 2: VersionEEring

What is version control?

Page 3: VersionEEring

What is version control?A program that tracks changes to files and folders for you.

Page 4: VersionEEring

Also goes by these names.Source Control Manager (SCM)Revision Control System (RCS)Version Control System (VCS)That-Thing-That-Just-Saved-My-Ass

Page 5: VersionEEring

Different flavors?Yup. Each has its own way of tracking your changes. Here are a few:

CVS - SVN - Git - Mercurial - Bazaar Darcs - Perforce - Fossil - BitKeeper

http://en.wikipedia.org/wiki/List_of_revision_control_software

Page 6: VersionEEring

What kinds of files?Text! But also:

GraphicsBinaryWHATEVER YOU WANT.

Page 7: VersionEEring

Why use version control?

Page 8: VersionEEring

Because this sucks.

Page 9: VersionEEring

Because this sucks.

Page 10: VersionEEring

Because this really, really sucks.

Page 11: VersionEEring

How to get started.No servers, nothing fancy -this is all local, baby. So no excuses.

Page 12: VersionEEring

1. Pick a system.We’re going with Git.

Page 13: VersionEEring

2. Install it on your computer.http://git-scm.com/download

Page 14: VersionEEring

$  cd  ~/Sites/myproject$  git  init$  git  add  .

$  git  commit  -­‐m  "Initial  commit."

Change to the project folder.Initialize the repository.Add everything in the project folder to the repository.Make your first commit.

3. Set up a repository for your existing project.

Page 15: VersionEEring

4. Make some changes, and commit them.

$  git  status$  git  add  index.html$  git  status

$  git  commit  -­‐m  "Added  homepage."

Tell me what’s changed. (New file!)Add the new file to the repository.Tell me what’s changed. (Just making sure we didn’t miss anything.)Commit the change.

Page 16: VersionEEring

5. Rinse and repeat until you’re ready to share.

Page 17: VersionEEring

A Basic WorkflowOne way to use version control in practice, with actual live websites.

Page 18: VersionEEring

1. Define your environments.

Some popular ones:

- Local- Development (overkill for team of one)- Staging (can be same as Development)- Live

Page 19: VersionEEring
Page 20: VersionEEring

Workflow show ‘n tell

Page 21: VersionEEring

Git and EE, sitting in a tree.

Page 22: VersionEEring

Gotcha #1:Paths.Let’s play with settings!

Page 23: VersionEEring

1. Make all paths in the Control Panel relative.EE1: Admin > System Preferences > General Configuration

EE2: Admin > General Configuration

Page 24: VersionEEring

Don’t forget uploaded files and generated images.EE1:Admin > System Preferences > Captcha Preferences(Each upload destination) Admin >Channel Administration > File Upload Preferences(Each channel) Admin > Channel Administration > Channel Management > Edit Channel Preferences

EE2: Admin > Content Administration > File Upload Preferences

Page 25: VersionEEring

Gotcha #2:Environment variables.Let’s play with config files!

Page 26: VersionEEring

Gotcha #3:User-generated files.Keeping filesystems in sync.

Page 27: VersionEEring

Gotcha #4:Databases.Pick your poison.

Page 28: VersionEEring

Further ResourcesNew to version control? Check out Version Control for Designers: http://hoth.entp.com/output/git_for_designers.html

Not new to version control, but new to Git? Check out Git Reference: http://gitref.org/

More on the topic of Git and EE:

http://gititon.masugadesign.com/ <-- A++ WOULD RECOMMEND

http://j.mp/ee2multiserver