This post is from the CollabNet VersionOne blog and has not been updated since the original publish date.
Code, Test and Deploy in the Cloud
The benefits of using cloud-based software development services are pretty clear these days. You can be up and running near instantaneously with a rich framework of tools at your disposal for relatively little cost compared to setting up and maintaining these systems in-house. Using cloud-based developer tools allows you to focus on your core product, without the headache and constant distraction of maintaining non-core services.
Here I’ll give you a step-by-step rundown on how to set up a solid Agile process for coding, testing, and deploying via the cloud. There are three basic concepts I’ll cover:
One application of these development practices comes from a configuration of MikeCI and Codesion. Recently, MikeCI, a hosted continuous integration service, connected with us via our API. We think it’s a pretty cool integration that is making your job, the developer, much easier!
1. Choose your build tool
From within the MikeCI application, click on New to create a new Job, and choose your build tool. Mike provides support for the following build tools:
- Maven – the increasingly popular open source tool for Java-based projects, from Apache. Mike can build your Maven projects and also publish a ‘site’ if required that can be viewed for each historic build.
- Ant – the very popular, widely used, mature, open source tool for software builds. Ant is an immensely powerful tool and is shipped with large number of standard tasks that perform the ‘heavy-lifting’ of a project build. In addition to the standard tasks, Mike also provides some useful additional third-party Ant libraries for use within your build.
- Rake – the Mike platform supports the popular Ruby-based build tool Rake. This allows developers to create Rake builds for their projects and wire them into Mike via the build job wizard.
2. Tell MikeCI where your source code repository is (SCM)
Assuming you have your source code stored under Subversion or Git, the first thing to do is setup your testing regime. From the MikeCI interface, tell it where your source code resides. It needs to know this so it can constantly poll the repository and perform a build when there’s a new checkin to the trunk.
Selecting ‘Use Update’ (recommended) means that MikeCI will checkout the project the first time a build is run and then take incremental changes from the repository for each subsequent build. If you uncheck this box, this will result in a complete checkout before every build which will increase the time each build takes.
You can specify that MikeCI should poll for changes in the state of your project according to a schedule. If no changes have occurred then no build will be run.
If you’re using Git, you’ll need to specify the branch you wish to build.
3. Set your build paramaters
Depending on which build tool you selected (Ant, Maven or Rake) you’ll have to enter the required parameters. Check out the MikeCI documentation for a detailed guide on these parameters.
Then, select your team members to be notified of a successful or failed build. From now on, your code will be tested continuously based on your project’s requirements.
You’re almost done, but you’ll want to be able to deploy your successfully tested code directly to your live production environment. The next few steps will show you how you can deploy to code from Codesion’s application.
4. Setting up a deployment recipe
Codesion Publisher will let you deploy directly from your source repository via SSH, Joyent, Amazon or Google App Engine. In the Codesion application interface, log in and select your project, making sure you’ve added Codesion Publisher as a service. Once added, click on “Add target.”
Enter in a name, description and choose the connection method (SSH, Joyent, Amazon, Google App Engine). Then enter the credentials to access your server or cloud instance (hostname, port, username, password, SSH key).
Next choose a recipe. Depending on where your source code is stored, i.e. under Subversion or Git, please choose either (SVN SCP, SVN rsync, or Git rsync). Depending on what you’ve chosen, Codesion will suck your code out of either Subversion or Git and copy it over via the SCP or rsync protocol. SCP will copy over the entire code based each time, whereas rsync will only copy differences since your last deployment. I’d recommend rsync if this option is enabled on your server, since its much faster for larger deployments.
Configuration is done! Now all you need to do is click on the “Publish” action on the Project page for your Codesion project each time you want to deploy your code live or to a test server.
For more advanced users, you can deploy in parallel to multiple servers. For example, if you have a web server farm where each server is configured identically for fail over and load balancing purposes.
Check this out for yourself! Set up a 30 day-free trial of MikeCI and Codesion.