CI server

A CI server is also known as a build server. With teams working on multiple branches, it gets complicated to merge back into the master. CI, in this scenario, plays a key role. CI server hooks provide a way to trigger the build based on the event when code is committed to the repository. Hooks, which are incorporated in almost every version control system, refer to custom scripts that are triggered by specified necessary actions that also occur in a repository. Hooks can run either on the client side or on the server side.

Pull requests are a common way for developers to notify and review each other's work before it is merged into common code branches. A CI server provides a web interface to review changes before adding them to the final project. If there are any problems with the proposed changes, source code can be sent back to the developer to tweak as per the organization's coding requirements.

As shown in the following diagram, server-side hooks in combination with the CI server are used to increase the velocity of integration:

Automation of CI

As illustrated in the preceding diagram, using post-receive, you can direct new branches to trigger tests on a CI server to verify that the new build integrates correctly and that all units function correctly. The developer is notified of test failures and then knows to merge their branch with the mainline only after the problems have been fixed. The developer can build from their branch, test the changes there, and get feedback on how well their changes work before deciding whether to merge their branch into the mainline. 

Running integration and unit tests significantly reduces resistance when that branch is merged into the mainline. Hooks can also be customized to test merges into the mainline and block any merges that don't pass. Integration is all accomplished best with a CI server.

Jenkins is the most popular choice to build the CI server. However, you have to maintain security and patching of the server by yourself. For native cloud options and managed services, you can use managed code-build services such as AWS CodeBuild, which eliminates the need for server administration and reduces costs significantly with a pay-as-you-go model. The service scales as per your demand. Your team is empowered to focus on pushing code and lets a service build all the artifacts.

As illustrated in the following diagram, you can host the Jenkins cluster in the AWS Elastic Compute Cloud (EC2) server's fleet and auto-scale as per build load:

Auto Scaling of Jenkins CI servers

The Jenkins Master offload builds to the slave node instance in the case of overload. When the load goes down, the Jenkins Master automatically terminates slave instances.

While a CI server helps you to build the right version of code from a source code repository by collaborating across team members of the development team, code deployment helps the team to get code ready for testing and release for end-user consumption. Let's learn about code deployment in more detail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.185.147