Setup Build - SCM System from beginning

This topic is specially for users who are new to the Build, SCM and Release Management and need to understand how can they setup the infrastructure and what are their options.

To Build the system to automate the build and deployment process there are few main areas which needs to be covered. Following are our prerequisite.

- Source code 
 - Builds System
-  Deployments
- QA Automation

To describe above here are main ingredients


- Configuration Management
 - continuous integration/ Automated Build
 - Automated Deployment
 -  Automated testing

**Configuration management**

Very fist step is to align your development practice is to select the right Source control tool. Once you have tool then you need to think of branching policy to make sure the starting point of the workflow is well defined and accepted by developers during their development phase.
There could be lots of process around merging, branching code review etc which needs to be address and policy driven. Some key points could be

- Developments and release branch should be separate.
- Each change goes qualifies for next stage only if reviewed.
- Code quality (static analysis ) should not go down.

Following are your options

Source control tool
- SVN (Free)
- CVS (Free)
- Git (Free)
-Perforce (Paid)
-Clearcase (Paid)
I would suggest git may be the best suitable source code tool for same. SVN can also be used with few scripting from admin part and may come out with very nice features.

**Build system**

Team needs to have robust and automated build system which can take care of all our needs (build, analysis, deployment etc).

- There need to have automated build system which can keep building the source code from various branches to make sure we catch the broken piece fast.
- Build can run the unit test and provide report
- Build can check the health of the code by running findbugs and checkstyle (if any).
Above checks can verify the heath and quality of the code (static analysis).

Nothing should go beyond this point if any of above is not matching with our criteria.

Tools - I would suggest git+ jenkins work best here. We can make use of Git pull request to be build via jenkins to make sure pull request code is not bringing code quality down. We should use maven repository management to handle artifacts like nexus or artifactory.

Till this point we have reached to qualify the minimum criteria for continuous Integration.

Here are few tools which comes under Build system

Build Tools

 - Ant
- Maven
- Gradle
- Make

CI tool

 - Jenkins
- Cruise control
- Luntbuild

Repository management

 - Nexus
- Artifactory
(Above are not open source but they are free to use with limited features).

Code quality check

 - Findbugs
- jacoco
- cobertura

**Deployments -**

Deployments are the next big bottleneck for the continuous delivery.
We need to have Deployment tool to move ahead, We can choose

- configuration management tool like puppet or chef
 - Private cloud management (Openstack)
- Third party tool like xl deploy, Udeploy etc..

Deployment strategy can be choosen on the basis of our need and the tool we are using, most of the plugins are available in jenkins (or bamboo) to make tight integration of build and deployment.
(At this stage i am not considering the dynamic provisioning of hardware in this section).

**Automated testing**

Once deployment phase is over QA regression suit can be trigger via jenkins (or any other tool) and entire reports can be publish to central QA metrics board.
This this point we can even use jacoco/cobertura to provide functional code coverage(for Java code) to demonstrate how much % of code QA regression/automation is covering and what is the level of automation.

Similar way job can be setup to raise jira/bug ticket to file issues found during any of the above step.

Finally we can have last step which can perform the final release build and push to staging /production in similar fashion.

**Resource Provisioning**

Developers/QA can just get the hardware either from infra team or if auto provisioning is enabled they can setup the environment and use the jenkins to perform build+deployment+QA

If we talk about automatic scaling of environment, we can use AWS for same.
Jenkins has AWS plugin to launch instance, This can be setup to launch instance dynamically and run the application and perform the QA Automation. Once need is over aws instance can be terminated automatically.


Popular posts from this blog

Colour formatting - Jenkins Console

Manage Docker images on local disk

How to migrate Parent pom from maven to gradle