The CD helps in achieving the Sprint targets on time. Faster builds speed up the whole system and minimize integration issues. In conclusion, we can say that Continuous deployment of builds saves time for both Dev and QA teams.
Continuous Integration
In today’s growing IT industry, the requirements need frequent updates and multiple developers have to push small and frequent code changes to the repository. Then it becomes necessary to validate the code on every check-in and get the build deployed successfully. Continuous Integration tools aid the detection of quality related issues in the early development stages and the development team has a certified build at the end of Continuous Integration.
Below are the reasons why CI should be considered before the beginning of a project:
- Run the tests in real world
- Increase code coverage
- Automatic build generation and deployment
- Quick builds to accelerate the release and increase the productivity
- Don’t break stuff
- Decrease code review time
CI Tools That Are Currently Used As Per Market Studies
Best Practices Of CI
Regular Commits To Master Branch
By implementing CI tools, we can commit and merge even small code during development to avoid creating a stack and optimize the development cost by early detection of issues.
Build Automation
Rather than manually generating the build, CI automatically triggers the build for every code check-in and certify that the changes are good to merge.
Testing The Code Changes
By using CI tools, we can have a specified set of tests to run automatically and ensure that the code committed by Dev team has not damaged the existing functionality. This saves our time from validating the existing features with the code changes.
Build Fast
Once the CI tool detects any update in the code, it segregates the tests to different machines. As a result, the build process becomes faster and consumes less power and resources.
Pre-Production Testing
When the code is ready for deployment, the CI tools ease the maintenance of multiple environments at the same time. We can have the production-like staging environment where we can check for any integration issues before pushing the changes to production.
Showcase Build Results
With the help of reports generated from the deployment status of builds, we can decide the correct actions for the failures by referring the detailed logs. Also, we can refer the previous logs whenever any comparison is required to detect the reason of failure.
Preferred Cloud Based CI/CD Tools Disinter Notes
-
CircleCI
- CircleCI allows the engineers to distribute their tests across the containers to execute these independently on a clean environment without installation of any additional package
- CircleCI runs on the Docker container and refers the YAML file to setup the environment required for testing
- Free availability up to one container. It is GitHub and Bitbucket friendly to integrate the data securely and get the automated build setup
- Recommended for the quick start projects where less time is required for configurations
- https://circleci.com
-
Travis CI
- Travis CI is recommended due to its flexibility to simultaneously execute the tests on different environments. It supports more languages than the CircleCI and supports build-matrix which could be achieved in CircleCI by creating multiple jobs
- It works with YAML configuration file which is data oriented file and contains richer metadata
- By default, Travis CI runs on Container-based virtualization environment
- https://travis-ci.org
Tips And Tricks |
---|
In Travis CI, name of YAML config file should start from ‘.’ i.e. '.travis.yml' and in CircleCI, the config.yml file should be placed in .circlecI repository in the project repository
|
All the project files and folders should be under parent directory of Travis CI
|
If new build fails and previous build is working, then we need to restore the updated dependencies to previous working version
|
Always define specific image version in config.yml file e.g., - image: CircleCI/openjdk:8-jdk. This will prevent the build environment from getting automatically updated or configure unexpected changes in the environment
|
For saving overall build time, set few jobs to be run in the background by keeping the available resources in mind
|
CircleCI 2.0 permits the re-execution of failed workflow jobs only, so consider the rerun of these failed jobs to quickly address the failures
|
Latest Updates In CI
Have Suggestions?
We would love to hear your feedback, questions, comments and suggestions. This will help us to make us better and more useful next time.
Share your thoughts and ideas at knowledgecenter@qasource.com