Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Martin Fowler - Thoughtworks
Various open source and commercial Continuous Integration (CI) tools are available, but the good news is that Maven is both widely supported and easy to set up regardless of what tool is selected. Classy Data is proven on Jenkins which is a popular open source CI server. Some guidelines for setting up Classy Data on Jenkins follows. However, the details here are generally applicable for any CI server. Note that key Jekins plugins required are Maven Project Plugin and Git Plugin.
Environment
You will need to:
- Set the Android environment parameter. On Jenkins this means configuring the node which performs the build (see box below).
- Ensure the user under which the CI Server runs has access to Git or whatever source control system you are using.
- Configure the location and scope of the Maven repository for each project (Jenkins has options)
- Make provision for both snapshot and release builds
Creating a Maven project for Classy Data is easy with Jenkins as it extracts most of the build details from the Maven configuration. It creates a workspace location where the build takes place. When setting up a build environment for Maven projects, consider how to deal with Maven artifacts. Having a Maven repository dedicated to the project is recommended to achieve isolation from other projects. Setting up a local Maven repository server, such as Artifactory, is also helpful so build artifacts are generally available for users and CI projects.
Set the Android environment parameter
The default Jenkins node is named "master".
Go to: Jekins -> nodes -> master -> configure.
Under "Node Properties", click "Add" and set a key-value pair as name = "ANDROID_HOME" and value = <Android-home-location> eg. "/usr/local/adt/sdk".
Click "Save" to finish.