avatarJoel Belton

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

3283

Abstract

minor updates allow opportunities to experiment and compare using A/B testing or deploying new versions over time.</li><li><b>Increased quality of code </b>— Automated testing ensures consistency and that all our code works efficiently and with fewer bugs.</li><li><b>Measurable Progress</b> — Many tools available that provide our CI/CD also can provide valuable metrics such as test coverage, build times, and defect rates.</li></ul><figure id="1d22"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*ToPGnAVYJF8HtXDDEsEKwQ.png"><figcaption>Image Created by Author</figcaption></figure><h1 id="6299">Considerations when building a pipeline</h1><h2 id="2f34">Code reviews</h2><p id="66d1">Code reviews are essential as so many deployments are happening, and the assurance of a second pair of eyes on any given change is instrumental. This can often catch bugs and inefficiency/best practices that our automated testing might not pick up.</p><h2 id="3bee">Containerise the Environment</h2><p id="0a8a">Our priority should always be to containerize our whole environment. This can help us in various ways, including scalability, packaging, easier deployments, and debugging. Setting this up before any pipelines will make the development process much more manageable. It allows you to focus on a container-by-container basis rather than tackling the whole application simultaneously.</p><p id="022c">We can also use tools like Docker to run many of our build automation tasks for us.</p><h2 id="2ca6">Test-driven development</h2><p id="4736">Test-driven development (TDD) is a methodology focusing on writing tests to specify what our code achieves before any development work is done. This can come with numerous benefits, such as <i>higher quality code, better documentation, and a more modular development process.</i> While this approach reduces our time to market, using our automated tests will ensure new features can be developed quickly with high assurance.</p><h2 id="4056">Comparisons and use of metrics</h2><p id="6769">One of the main advantages of integrating a CI/CD pipeline is that we can regularly incorporate a large volume of small changes. To ensure we can make the most of this, implementing a monitoring tool such as ELK or Prometheus would ensure we can track the value of a given change.</p><h2 id="6697">Rollback changes</h2><p id="5904">Although CI/CD pipelines aim to reduce our likelihood of implementing bugs, we can reduce risk further by having an easy-to-use backout procedure. Ideally, with a single button click, we can roll back to the previous state if something goes wrong.</p><h2 id="ea08">Proactively monitor your CD pipeline.</h2><p id="c403">As much as we’d like to set up our pipeline and it works forever, changes to our environments over time or unpredictability can cause our CI/CD to break. To ensure this, we should actively monitor our pipelines to ensure they are working as expected. Effective pipelines should always be giving the same output for any given input.</p><h1 id="9438">Tools</h1><p id="721c">Listed below are the essential tools for any given category, depending on how complex your application will depend on how many of these you would want to implement.</p><p id="8590"><i>This is not an extensive list

Options

but a fairly representative catalog of the primary categories and my personal favorites.</i></p><ul><li><b>Containerisation </b>— Docker & Kubernetes, Docker Swarm, Nomad</li><li><b>CI/CD</b> — Jenkins, Gitlab, Bamboo, Travis CL</li><li><b>Cloud </b>— AWS, Azure</li><li><b>Testing </b>— JUnit, Pytest, Robot Framework</li><li><b>Version Control</b> — Git, Github, Bitbucket, Gitlab</li><li><b>Build —</b> Gradle, Maven</li><li><b>Configuration Management & Automation</b> — Puppet, Chef, Terraform, Ansible, Vagrant, Saltstack</li><li><b>Monitoring</b> — Prometheus, ELK</li></ul><p id="3051">Thanks for reading. Don’t forget to Clap if you’ve enjoyed!</p><p id="2287">I regularly post articles on DevOps articles exclusively on Medium — If you would like to read more, I recommend checking out the stories below.</p><div id="f8ce" class="link-block"> <a href="https://readmedium.com/optimising-docker-performance-the-key-4-techniques-you-need-6440cfebb650"> <div> <div> <h2>Optimizing Docker Performance — The Key 4 Techniques You Need</h2> <div><h3>Docker containers and containerization technologies have changed the cloud industry forever. Thousands of new…</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*IRoc4wml4-DAKin7CyoTQg.jpeg)"></div> </div> </div> </a> </div><div id="16a0" class="link-block"> <a href="https://readmedium.com/learning-containers-from-the-ground-up-a-roadmap-to-success-dd16151b2388"> <div> <div> <h2>Learning Containers from the ground up — A Roadmap to Success</h2> <div><h3>Containerisation has become a significant trend in software development and a quickly growing alternative to…</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*dFCFyXjMz34I9PKIKVb7-A.png)"></div> </div> </div> </a> </div><p id="1fa5">If you liked this article and you’re not a member, consider supporting me and thousands of other writers by <a href="https://medium.com/@joelbelton/membership"><b>signing up for a membership</b></a> and get unlimited access to content from Medium’s fantastic writers. Your membership directly supports me with a portion of your fee and won’t cost you more.</p><div id="f665" class="link-block"> <a href="https://medium.com/@joelbelton/membership"> <div> <div> <h2>Join Medium with my referral link - Joel Belton</h2> <div><h3>Read every story from Joel Belton (and thousands of other writers on Medium). Your membership fee directly supports…</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*LReEgKbd56Vps-Lt)"></div> </div> </div> </a> </div></article></body>

Most Important Things You Need to Consider when Building CI/CD Pipelines

What are CI/CD Pipelines, and how can we get the most out of them

In a new age of cloud computing and the ever-increasing demand for complex architecture, DevOps is quickly evolving and rapidly becoming one of the most desired skill sets for any developer. The speed and confidence with which you can deliver features to your users becoming increasingly important. CI/CD provides stability using a streamlined pipeline to get your changes to market faster.

Photo by T K on Unsplash

What is CI/CD

CI/CD is a hugely popular DevOps practice that creates quick and easy pipelines for developers to get their code into production. These usually include testing facilities, build automation, and staging and production systems deployments. We can leverage automation tools to trigger pipeline flows whenever code is committed to source control.

Continuous Integration (CI) is a practice in which code can get integrated on demand, as often as hundreds of times a day, depending on the company’s size. This Integration piece will verify the code written and ensure that it doesn’t contain bugs, and can give early feedback on the impacts of the new features.

Continuous Delivery (CD) is our next step in the pipeline. This methodology intends to ensure that after each and every commit, the code is pushed to production systems. This will include build automation and deployment steps to push the change through staging environments all the way to a live system.

Amazon has utilized CI/CD concepts and tools to boast a deployment frequency of every 7 seconds!

What is a pipeline?

A pipeline is a sequence of actions triggered to progress our new code through our software delivery stages. A typical pipeline will go through steps such as building, testing, and deployment to staging and production environments.

Visualization of an example pipeline below:

Image Created by Author

What are the benefits of CI/CD?

  • Faster time to market — New features can be launched faster and problems fixed quickly. Being able to push swiftly and confidently means we can respond to trends as they emerge.
  • Smooth Productionisation — Adding automation for builds makes steps repeatable and consistent, making us more efficient.
  • Reduced Risk — Testing with unit tests and pre-production environments means we can validate our code and find and fix bugs quickly.
  • Feedback Loop — Shipping regular but more minor updates allow opportunities to experiment and compare using A/B testing or deploying new versions over time.
  • Increased quality of code — Automated testing ensures consistency and that all our code works efficiently and with fewer bugs.
  • Measurable Progress — Many tools available that provide our CI/CD also can provide valuable metrics such as test coverage, build times, and defect rates.
Image Created by Author

Considerations when building a pipeline

Code reviews

Code reviews are essential as so many deployments are happening, and the assurance of a second pair of eyes on any given change is instrumental. This can often catch bugs and inefficiency/best practices that our automated testing might not pick up.

Containerise the Environment

Our priority should always be to containerize our whole environment. This can help us in various ways, including scalability, packaging, easier deployments, and debugging. Setting this up before any pipelines will make the development process much more manageable. It allows you to focus on a container-by-container basis rather than tackling the whole application simultaneously.

We can also use tools like Docker to run many of our build automation tasks for us.

Test-driven development

Test-driven development (TDD) is a methodology focusing on writing tests to specify what our code achieves before any development work is done. This can come with numerous benefits, such as higher quality code, better documentation, and a more modular development process. While this approach reduces our time to market, using our automated tests will ensure new features can be developed quickly with high assurance.

Comparisons and use of metrics

One of the main advantages of integrating a CI/CD pipeline is that we can regularly incorporate a large volume of small changes. To ensure we can make the most of this, implementing a monitoring tool such as ELK or Prometheus would ensure we can track the value of a given change.

Rollback changes

Although CI/CD pipelines aim to reduce our likelihood of implementing bugs, we can reduce risk further by having an easy-to-use backout procedure. Ideally, with a single button click, we can roll back to the previous state if something goes wrong.

Proactively monitor your CD pipeline.

As much as we’d like to set up our pipeline and it works forever, changes to our environments over time or unpredictability can cause our CI/CD to break. To ensure this, we should actively monitor our pipelines to ensure they are working as expected. Effective pipelines should always be giving the same output for any given input.

Tools

Listed below are the essential tools for any given category, depending on how complex your application will depend on how many of these you would want to implement.

This is not an extensive list but a fairly representative catalog of the primary categories and my personal favorites.

  • Containerisation — Docker & Kubernetes, Docker Swarm, Nomad
  • CI/CD — Jenkins, Gitlab, Bamboo, Travis CL
  • Cloud — AWS, Azure
  • Testing — JUnit, Pytest, Robot Framework
  • Version Control — Git, Github, Bitbucket, Gitlab
  • Build — Gradle, Maven
  • Configuration Management & Automation — Puppet, Chef, Terraform, Ansible, Vagrant, Saltstack
  • Monitoring — Prometheus, ELK

Thanks for reading. Don’t forget to Clap if you’ve enjoyed!

I regularly post articles on DevOps articles exclusively on Medium — If you would like to read more, I recommend checking out the stories below.

If you liked this article and you’re not a member, consider supporting me and thousands of other writers by signing up for a membership and get unlimited access to content from Medium’s fantastic writers. Your membership directly supports me with a portion of your fee and won’t cost you more.

DevOps
Technology
Development
Infrastructure As Code
Programming
Recommended from ReadMedium