Continuous Integration
Continuous Integration with Travis CI
Last updated
Continuous Integration with Travis CI
Last updated
Continuous Integration is the process of continuously integrating every developer's change into the master branch after a set of tests have passed, resulting in potentially deployable code.
Continuous Delivery is a series of practices designed to ensure that code can be rapidly and safely deployed to production by delivering every change to a production-like environment.
Developers work in long lived development branches
Branches are periodically merged into a release (with lots of breakage)
Build are run periodically (e.g., nightly) on release candidate branch
Developers continue to add to the development branch which drifts further and further from the master branch
A development practice that requires developers to integrate code into a shared repository often (e.g., daily)
Developers work in short lived feature branches that are merged into master
Each check-in is then verified by an automated build, allowing teams to detect problems early and often
Committing regularly, every developer can reduce the number of conflicting changes: Checking in a week's worth of work runs the risk of conflicting with other features and can be very difficult to resolve
Using Pull Requests allows team members to communicate about the change they are making
Committing all changes at least once a day (once per feature built) is generally considered part of the definition of Continuous Integration
The system should build commits to the current working version to verify that they integrate correctly
A common practice is to use automated Continuous Integration where a continuous integration server or daemon monitors the revision control system for changes, then automatically runs the build process
Once the code is built, all tests should run to confirm that it behaves as the developers expect it to behave (i.e., make the build self-testing)
Faster reaction times to changes
Reduced code integration risk
Higher code quality
The code in version control works
Less deployment time
Build quality in
Work in small batches
Computers perform repetitive tasks, people solve problems
Relentlessly pursue continuous improvement
Everyone is responsible
A code repository to host and manage all your source code
A build server to build the application from source code
An integration server/orchestrator to automate the build and run test code
A repository to store all the binaries and artifacts of the application
Tools for automatic configuration and deployment
For business to take advantage of continuous integration and continuous delivery, they must:
Have an application design that allows services to be deployed quickly and independently
Have automated all of their testing
Have organizational trust that allows autonomy and shared responsibility
Have fast feedback loops with minimal Mean Time to Recovery
Travis CI is a Continuous Integration tool
It allows you to treat your CI pipeline as code
It can also do deployments for Continuous Delivery
"Continuous Delivery is a software development discipline where you build software in such a way that the software can be released to production at any time" — Martin Fowler.
That means:
The Master branch should always be ready to deploy
You need a way to know if something will "break the build"
Travis CI gives you a way to achieve this.
Automated Testing is CRITICAL to Continuous Integration
Travis CI can work with any language and any test suite
Lots of languages and test suite support is built-in
Database support is built-in
Webhooks allow Travis-CI to run on every Pull Request
Status is delivered to the Pull Request before a merge