Magento web development setup with Beanstalk, Versions and Coda

We’ve used the Magento ecommerce platform for 3 projects recently, and I thought it would be useful to share the setup steps we go through for our Beanstalk + Versions + Coda web development environment.

About the development tools

Beanstalk is a hosted implementation of the SVN source code control. Versions is an SVN client tool on the Mac, and Coda is an editor and web publishing tool. Magento is a powerful ecommerce platform available in both Open Source and Enterprise editions.

Overview

We essentially go through 6 steps:

  • Setting up the SVN repository in Beanstalk
  • Setting up a working copy in Versions
  • Committing the Magento download files to the repository
  • Deploying the initial download files to the development server
  • Setting up the database and configuring Magento
  • Setting up the site in Coda

We can then begin coding our website.  I’ll take you through each of those steps in turn.

Setting up the SVN repository in Beanstalk

BeanstalkWe store the code for all our website projects in Beanstalk SVN repositories.  In a large ongoing project, it allows us to develop and test new functionality independently of the main website.  We also use it for short ‘single hit’ developments, benefitting from the knowledge that our code is safely backed up, and we can easily revert to an earlier version should we accidentally delete or corrupt a file.

For a Magento ecommerce project, we create a standard repository in Beanstalk:

  1. Choose the ‘create a repository’ button from the Repositories tab
  2. Give the repository a name, e.g. My New Shop
  3. Select all the default options (including ‘Create the repository from scratch… Create default repository structure’)

Setting up a working copy in Versions

Logo versionsBeanstalk holds our files and code securely.  Versions is the tool (SVN client) that lets us manage the files: uploading them to Beanstalk, downloading working copies to our local machine, and committing changes once we’ve finished our edits.

For our new online shop repository, we need to set up a working copy in Versions by:

  1. Bookmarking the repository (choose the option to ‘create a new bookmark to a repository URL’)
  2. We then select the trunk folder in Versions, and choose the checkout option
  3. We are prompted for a local folder to store the working copy files in.  We have a folder for all our development projects, and create a folder for each project under there, e.g. development/mynewshop

At this stage the relationship between Beanstalk, Versions and our working folder has been established, but we’ve yet to load any files into the project.

Committing the Magento download files to the repository

Magento ecommerce logoAt this stage, we take the Magento files from the download zip (on the Magento site), and copy them into our working folder (i.e. development/mynewshop).

Once the files have been added, we return to Versions, where we:

  1. Select the files, and choose add (top right menu bar) to bring them under SVN control
  2. Commit the files to the Beanstalk repository

Note: You have some alternative choices here.  Magento is a big system, with nearly 45MB of files.  We choose to  bring the whole download under SVN control, but you may prefer just to have your app/design, app/code and skin folders under SVN control.  You can find discussions of the pros and cons of this, in particular with reference to supporting future Magento upgrades, in other posts on the Internet.

Deploying the initial download files to the development server

We are now ready to deploy the Magento files to our development server, setup a database, and perform the initial Magento configuration.

Beanstalk has built in capabilities for deploying your website files to a staging, development or production server.  Due to the size of Magento, we’ve encountered timeouts problems using Beanstalk for the initial deployment of the files.

Instead, we use our standard ftp tool, Cyberduck, to transfer the Magento files to our development server.

Setting up the database and configuring Magento

With our files transferred to the development server, we then follow the Magento Installation guide (Default Install section), to set up the database and configure Magento.

Setting up the site in Coda

Coda web development environment logoThis is the final step in setting up our Magento web development environment.

To this point, we’ve set up our SVN repository in Beanstalk, created a working copy in Versions, established a folder for our local working copy, and committed the initial Magento download files to Beanstalk.  We’ve also deployed the Magento files to our development server, setup the database and configured Magento.

We then follow the standard procedure to setup the site in Coda:

  1. Choose the ‘Add Site’ button from the bottom of the Coda Sites window
  2. Enter the site name: My New Shop; the remote root: url of the development server; and the local root: our working copy folder (e.g. development/mynewshop
  3. Enter the ftp connection details
  4. Enable Source Control and enter the Beanstalk repository url, Beanstalk username and password

That’s it… Beanstalk SVN, Versions, Magento and Coda are all setup, and we are ready to start the development and skinning of our Magento ecommerce web site.

Tags: , , ,

RSS 2.0 Both comments and pings are currently closed.

2 Responses to “Magento web development setup with Beanstalk, Versions and Coda”

  1. Nick says:

    Interesting article. I set up an existing Magento site in Beanstalk this week. As the site was already live (and not currently under version control – naughty!), the process was a little bit different.

    What I did learn though, is that it is best to set up some folders/files to be ignored from SVN, as these can differ between dev, staging and production. I figured the following are best ignored:

    /app/etc/local.xml

    /downloader/pearlib/cache/

    /downloader/perlib/download/

    error_log

    /media/

    /var/

    Thanks again for a great article!

  2. @Nick: thanks for the feedback

    I’ll take a look at your ‘ignore’ folder recommendations… and fine tune what we include under SVN control for future Magento projects.