ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

What's Your Version Control Workflow?

October 29, 2010 12:10pm

Subscribe [6]
  • #1 / Oct 29, 2010 12:10pm

    Geoff Towle

    330 posts

    I’m wondering if anyone is doing version control utilizing Versions and Beanstalk (or just SVN), and if so, what your workflow is.  I have read through Ryan Masuga’s presentation using Git but am a bit lost on some of the specifics, such as config overrides—I couldn’t make it to the Netherlands to hear the detailed explanations!  😊

    I’d also be interested to learn how you setup your repo (trunk & branches), where you save your templates, and how you handle databases.

    Thanks!

  • #2 / Oct 31, 2010 1:08am

    Green Egg Media

    111 posts

    Geoff Towle -

    We used to use Beanstalk at Green Egg Media, but have switched entirely over to Git and GitHub now. It is much better, and I would recommend taking a look at it.

    Database control is one of the hardest parts. For some projects, we use a shared remote database so we’re all accessing a single data set. For other projects, we utilize local databases. If you’re using local databases, you may need to put a SQL file under version control and commit it to the repo now and again for your developers to use. When we work locally, we typically only worry about things when the actual structure of the DB changes.

    Lance
    Green Egg Media

  • #3 / Nov 01, 2010 5:27pm

    Geoff Towle

    330 posts

    Lance–

    Thanks for the feedback.  I will consider the switch to Git, since I keep hearing that is a superior method and I haven’t invested much time into SVN.  Do you use a Git GUI or command line?

    Geoff

  • #4 / Nov 02, 2010 6:37am

    Focus Lab Dev Team

    1129 posts

    Geoff,

    We’re right there with Lance / Green Egg Media. Using Git for version control and a mixture of GitHub & Beanstalk depending on the project. Same thing for the database changes as well. Sometimes we all point to a dev database but other times we have local copies (if our development is likely to screw with things in early alpha stages).

    Config overrides are huge for us. Did you have any particular questions about the approach?

    We start every project with 2 branches. Master is whatever is “live” and “dev” is our fully committed development version. We branch for each feature we create (which is typically handled by a single developer) and we branch for bug fixes on the Master branch when necessary.

    I personally have checked out all of the Mac Git GUIs available and never really loved any of them. I’ve been looking out for something comparable to Versions (SVN) but thus far I’ve just stayed in Terminal for my Git interaction. That said, I just read about a new Git app this morning that looks quite promising. Git Tower.

  • #5 / Nov 02, 2010 2:54pm

    Geoff Towle

    330 posts

    Erik–

    Config overrides:  I wasn’t clear on what was being overridden, but I just took a closer look at the sample config file Ryan Masuga provides and have a bit more clarity now.

    Branches:  So would the Dev branch be what you (or other developers) are working with on your local machine(s), then you merge that with the Master?  And how do you make the transition from Git to Beanstalk?  What Trunk/Branch setup do you use there?

    Thank you kindly for the information.  It’s very helpful.  My reason for wanting to start using a version control system is two-fold: 1) just because it seems like the smart thing for me, alone, to do, and 2) because I do hire developers to work on projects and would prefer to have the repositories setup and ready to go, so I’m trying to figure out the best approach for both arrangements.

    Geoff

  • #6 / Nov 02, 2010 3:00pm

    Focus Lab Dev Team

    1129 posts

    Branches:  So would the Dev branch be what you (or other developers) are working with on your local machine(s), then you merge that with the Master?

    Exactly. Once a “feature” is complete we merge the changes with the Master branch and deploy that to the production server. Our production site always matches our Master branch. Our Dev site almost always matches our Dev branch. Our feature-specific branches are typically done “locally” then merged with the Dev branch once complete.

    And how do you make the transition from Git to Beanstalk?  What Trunk/Branch setup do you use there?

    Any branch you push to Beanstalk will automatically be added to the repository. So I do something like:

    $ git push beanstalk dev

    That pushes my “dev” branch out to Beanstalk. One thing I like about beanstalk is the auto-deployment feature because it will let me take care of those things straight from the command line (where I choose to interact with Git).

    We also have out commits pushed to Basecamp as private messages if it applies to the project. Beanstalk does that automatically for us if we set it up for each project. It’s quite the nice feature.

    Always glad to share my experience so feel free to ask other questions. I have much to share and much to learn 😊

  • #7 / Nov 02, 2010 3:05pm

    Geoff Towle

    330 posts

    Our Dev site almost always matches our Dev branch.

    Do you maintain a dev site online, such as http://dev.thewebsite.com, or http://www.thewebsite.com/dev?

  • #8 / Nov 02, 2010 3:07pm

    Focus Lab Dev Team

    1129 posts

    Do you maintain a dev site online, such as http://dev.thewebsite.com, or http://www.thewebsite.com/dev?

    It depends on the project. Most of the time, yes. We’ll have a “private development” environment like that and we may also have a “private staging” environment as well.

  • #9 / Nov 03, 2010 1:21am

    Geoff Towle

    330 posts

    Erik,

    Assuming you use .gitignore, do you FTP files, such as config.php, to the production and dev deployments upon initial setup?

    Geoff

  • #10 / Nov 03, 2010 5:45am

    Focus Lab Dev Team

    1129 posts

    Geoff,

    Yes, files that are ignored are initially uploaded manually (though config.php isn’t one we ignore).

  • #11 / Nov 05, 2010 2:26pm

    Geoff Towle

    330 posts

    Do you typically make any changes to path.php, or is it left alone?

  • #12 / Nov 07, 2010 10:06pm

    Focus Lab Dev Team

    1129 posts

    path.php stays the same once it’s been set (for the most part). I also got your email and reply with the details + example. I’m on the tail end of a conference weekend so I’ve been away from email for a little while.

  • #13 / Nov 09, 2010 7:55pm

    Geoff Towle

    330 posts

    Erik - thank you.

    Anyone - so I’m trying to wrap my (hard) head around this EE version control workflow.  I needed to make some minor changes to a site today, which included creating a new template, then modifying a couple of other templates.  The first question that came to mind is if I were to create a new template in my local installation (or any installation), I first have to access the control panel, create the template, then save as a file.  So that means I would need to update the database on the staging and production installations in order for the new template to be recognized.  Right?

    And what about making other changes in the control panel, apart from templates.  Let’s say I need to change some settings in the Member Preferences.  Would it be best to do that on the production site, then import the most current database to the other installations to be sure I don’t overwrite any content that has been posted to the site?  Or would I update the database on the local and staging installations from the production server each time prior to making any changes?  Even then, how do you know the production site hasn’t been updated since you ran the last dump, before importing the most current database back into the production installation?

    It seems that there is going to be a lot of database updating in order to keep the local, staging, and production sites in sync.  It almost seems like more work than it’s worth, or at least it feels that way as a version control rookie.

  • #14 / Nov 22, 2010 3:03pm

    SiteGoals

    15 posts

    I have the exact same problem wrapping my head around this as Geoff. Now that our most recent EE site has launched, I have no idea how to go about managing updates to the database. Just creating templates on the live site and downloading the files is enough of a pain, but I can’t even imagine dealing with installing modules and updating settings, etc.

    Would be it be possible to update a database on the live site but keep the existing channel content and member profiles?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases