Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Continuous Integration and Continuous Delivery

Most of us have heard about this many times but, do we really know what continuous integration (CI) and continuous delivery (CD) are and how they can be so useful?

Let’s picture a fictional scenario and assume that K+B is a company that creates Software for their clients. K+B deploys the software to the cloud and their clients just use it without prior download or installment.

Let’s take a look at how K+B works.

The software K+B produces 3 main modules which are managed by a specific development team.

Each team has its own source control so that the code is saved enabling the collaboration of all members of the team.

There is an integration team that at the end of the release merges all the modules into one bucket source control and builds the whole package. If there is no compilation error they pass the resulting software and the instructions to install it on to the operation team.

The operation team receives the software and the instructions from the Integration team and deploys the software into different environments (DEV / QA).

Afterwards, a QA team tests there‘s no major issue and right after that the software is deployed in production. In case there’s an issue there won’t be any release until the development team fixes it.

What can be improved?

Integration process

  • Integrating the code from each team happens once every iteration. This means that the integration team has a lot of merging to do which takes a lot of work and also, it is error-prone. There is just one moment in every iteration at which the development team can see if their code works well with other modules or not. As many of you can imagine this will take a lot of rework because one team may break the functionality of other team.
  • In case an error is found after merging the code, it is hard to replicate it in the developers PC, since every PC has specific versions of the software or libraries and the app could behave differently.
  • As the integration process is extremely laborious, it only happens once in every iteration and this can be improved using CI.

Deployment Process

  • The instructions to install the software are not always 100 % complete leaving some room for interpretation to the team. And this could cause some errors.
  • The instructions could not always be followed in the exact same way in every environment since sometimes they are different.
  • The deployment process could be improved using CD.

What can we accomplish with the improvements?

  • Software with higher quality and fewer errors
  • Faster software delivery
  • The whole process will cost less effort because of a minor complexity and lower costs.
  • We’ll have a better adaptation to the client’s requirements which turns into happier clients.

What is Continuous integration and how does it work?

Continuous integration is the practice of developers integrating their code into a central repository frequently.
  • The build process should be both automated and triggered every time a dev checks in the code.
  • All developers will have access to the build result. They can verify if their code is working or if something needs to be fixed.
  • The build process should have automated tests to ensure the best possible results. Tests should run every time a build is done.
  • The build process should be fast so that the result is checked by the dev very quickly.

Benefits of using CI

  • Every dev will merge his code. This should be easy because he is the one that knows the code.
  • As every check in will trigger a new build and this process will be fast, the developer could check if there is something wrong and fix it more quickly.
  • Issues are found faster which makes easier for developers to fix them as they are familiarized with the code.
  • The Automated build is less error-prone than manual build.
  • The whole process is more visible for everyone involved in it. Everyone will be able to see what changes were made and the results of the builds.
  • It improves the communication between teams.
  • Sharing a unique repository will prevent a team from breaking the functionality of another team at the end of the release.
  • Merging more frequently gives the company the ability to adapt better to the needs of the clients.

How CI can be implemented ?

There are some tools that makes CI easy to implement , such as Jenkins.

Jenkins is a popular open source tool aimed at executing a predefined list of steps and it can be configured to trigger the execution each time the developer checks in code to the source control.

Possible steps

  • Perform a software build using a build system like Apache Maven or Gradle
  • Execute a shell script
  • Archive a build result
  • Running software tests

What is Continuous delivery and how does it work?

Continuous delivery is a software development discipline in which the software can be released to production at any time.

I would like to mention the difference between Continuous delivery and Continuous deployment. In the first, we can deploy to production at any time. We can. This is a choice. In continuous deployment, software is automatically deployed to production all the time, continuously.

  • To implement CD, CI must be implemented.
  • The release process should be automated (scripts)
  • A task is complete when it is executed. Ok in production.
  • The software delivery must be on demand

Optionally, the environment creation could be automated which means all environment will be equal with less error-prone and easier to maintain.

Benefits of using CD

  • Releasing costs and less effort because all manual work is automated.
  • Releasing is more reliable (because the process will be automated) and repeatable (the same scrip is run)
  • Assigns the control of releasing in hands of the business
  • It allows the company to make more releases in less time. It is also important to notice that due to the clients feedback we’ll adapt better to their requirements.

What are feature toggles and why should I implement feature toggles when using CD?

If you want to implement CD you need your application to be deployable at all times. This is challenging when you have features that span multiple builds and bug fixing that need to get into production quicly.

I am sure we have all faced this issue before: imagine you have been working on a new functionality for weeks and you were checking in code as soon as you have some of the acceptance criteria working. Suddenly a critical bug appears and needs to be fixed as soon as possible in production but, you haven’t finished the new functionality mentioned before. How can you solve it?

Remember that in order to implement CD you need to have CI implemented first. So, creating branches is not an option. Some of us thought there isn´t a way to manage that situation without creating a branch , but luckily there is one: using feature toggles.

The basic idea behind feature toggles is that you have a configuration system that allows you to toggle a features on or off depending on your needs. Then , the running application uses these toggles to decide wheter or not to show the feature.

Feature toggles could be implemented in many forms. The simplest way is to have an static configuration file within your application that you deploy to the server for the feature toggle to take effects .

source : https://app.pluralsight.com/library/courses/continuous-integration-delivery-big-picture

Would you like to know more? Do you need our help? Contact Us!
www.quadiontech.com


Continuous Integration and Continuous Delivery was originally published in Quadion Technologies on Medium, where people are continuing the conversation by highlighting and responding to this story.



This post first appeared on Quadion Technologies, please read the originial post: here

Share the post

Continuous Integration and Continuous Delivery

×

Subscribe to Quadion Technologies

Get updates delivered right to your inbox!

Thank you for your subscription

×