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.
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
We 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:
- Choose the ‘create a repository’ button from the Repositories tab
- Give the repository a name, e.g. My New Shop
- Select all the default options (including ‘Create the repository from scratch… Create default repository structure’)
Setting up a working copy in Versions
Beanstalk 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:
- Bookmarking the repository (choose the option to ‘create a new bookmark to a repository URL’)
- We then select the trunk folder in Versions, and choose the checkout option
- 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
At 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:
- Select the files, and choose add (top right menu bar) to bring them under SVN control
- 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
This 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:
- Choose the ‘Add Site’ button from the bottom of the Coda Sites window
- 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
- Enter the ftp connection details
- 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.