Enterprise DevOps & Cloud Infrastructure

Continuous Integration & Delivery CI/CD

Erik Reinert

Erik Reinert

TheAltF4Stream
Enterprise DevOps & Cloud Infrastructure

Check out a free preview of the full Enterprise DevOps & Cloud Infrastructure course

The "Continuous Integration & Delivery CI/CD" Lesson is part of the full, Enterprise DevOps & Cloud Infrastructure course featured in this preview video. Here's what you'd learn in this lesson:

Erik compares Continuous Integration (CI) and Continuous Delivery (CD). CI involves automating code integration from multiple contributors into a single project and validates changes. CD focuses on delivering software in short cycles, getting it into production as quickly as possible. While CI and CD are often used together, they are not the same thing, and mixing the two should be done carefully.

Preview
Close

Transcript from the "Continuous Integration & Delivery CI/CD" Lesson

[00:00:00]
>> So we asked AI one more time, what is continuous integration? Continuous integration is the practice of automating the integration of code changes from multiple contributors into a single project. Pretty much, the TLDR is that CI is a way to validate changes using automation, right? So it's just about validating your changes.

[00:00:19]
What is continuous delivery? Continuous delivery is an approach to software engineering based on producing software in short cycles, right? So one is about validation, and the other one is about producing, actually, full cycle getting it out as quickly as possible, the way to deploy your code. Are CI and CD the same thing?

[00:00:43]
>> CD without CI is a really bad idea.
>> Yeah, for starters [LAUGH], yeah, that's great feedback, yeah. But should you mix your CI and CD together? Does it make sense to just do it all in one place? What do you guys think?
>> One should stop the other if it fails.

[00:01:03]
>> Yes, yeah, so they're not the same thing, [LAUGH] but they are often used together. I get this all the time where people say like, yeah, I've got CI/CD. And I'll be like, well, cool, what do you do? And they're like, yeah, we use GitHub Actions. [LAUGH] I'm like, okay, what do you do?

[00:01:23]
[LAUGH] And they're like, yeah, we use GitHub Actions. I'm like, that's not CD, that's just a pipeline. CI and CD are not the same thing. And there are a lot of providers out there who will try and sell you on CI as CD, CircleCI, right? It's not CircleCD, right?

[00:01:44]
But you can technically use CircleCI, right? As a way to deploy things, if you want, right? But it's not that they have them built into it, it's that you have something that can just run, right? You do the rest, so it's not so much that CI and CD are the same thing.

[00:02:03]
But sometimes the underlying components you use to run them can be the same thing, right? But they are not the same thing at all. So again, the TLDR is, is that CI validates code changes. Can anyone tell me when CI should run, any guesses? When should I see CI running?

[00:02:24]
>> Code committed.
>> Code committed, yep. Any other chances where CI might run?
>> It's really fast whenever it's saved.
>> Sure, what was that?
>> Configuration changes.
>> Configuration changes, yeah. Again, because we have GitOps, right? We can have CI for not only our code, but also our pipelines and our changes.

[00:02:49]
What does that mean? That means I can make changes in an automation branch and not break stuff, but know when I'm gonna [LAUGH]. And that's really powerful, right? So, CI can empower CD, right, by validating CD beforehand, and then CD is the next step. So it's more of like a handoff.

[00:03:09]
CI does everything it needs to, right, and then once it's done, it hands it off to CD. And that's exactly what we do, and the handoff for us at Hippo is a Docker image, right? So what we do is we build a Docker image in CI, and that's where it stops, we don't have CI then.

[00:03:26]
And again, this is what commonly happens is people will go, build, push, deploy, right? Don't do that, do build, validate all that stuff. But then have maybe another repo that you can have a web hook call to that will run a deployment for you. And then that repo has a standardized way of deploying things.

[00:03:47]
And that's exactly what we do at Hippo. We have what's called Hippo Deploy, which is a repo that just has actions that we can call from other repos in. And so that repo is all about deploying stuff, whereas all the other repos about integration and testing things. So there is that handoff there, and that handoff is very important.

[00:04:11]
So let's talk about some cloud providers for CI and CD. We've got GitHub Actions, which we will be using. We've got GitLab CI/CD, we've got AWS CodePipeline, Azure Pipelines. And the reality of it is, there's a bunch of stuff out there, there's tons of stuff. And honestly, I don't even have a real preference here.

[00:04:30]
I've used CircleCI, actually, for the majority of my time at Hippo. I have since really not grown to enjoy their services as much anymore [LAUGH]. And so I'm starting to now look at things like GitHub Actions. I've used GitHub or GitLab as well, they are all good solutions.

[00:04:50]
Just find the one that picks best or works best for you. I would recommend GitHub Actions if you're on GitHub. It's integrated right into the platform, everything's right there. It makes it really easy to view changes and stuff like that, right? Same with GitLab, if you're already on GitLab, might as well just use GitLab CI/CD, right?

[00:05:08]
CircleCI, those are more like completely separate entities. You plug them into your code, and then it runs against them. [LAUGH] So there's also open source solutions out there. This is my personal opinion, so do not get mad at me, but I do not think Jenkins needs to be around anymore.

[00:05:28]
So I don't recommend [LAUGH] Jenkins. You can use it, and you are welcome to if you would like. But I've used it so much in the past, I really do not think it's a productive system. Drone is another open source one. Drone was unfortunately, well, not unfortunately for them, they got bought out, however, it also got heavily licensed.

[00:05:53]
So you can run your own Drone clusters locally and stuff like that. But if you wanna do web hooks and status checks and stuff, which are common on other platforms, you have to pay a license for that. So Drone is limited, there's other things like Concourse and other things like that.

[00:06:11]
Basically, as we go down the list, the user experience, developer experience, and it's features become less, right? And I would say that's even more so for here as well. As we start going down, we start feeling that same thing. There is one other thing I wanted to note, because these are things that I'm actually getting into more now.

[00:06:34]
Because I'm running Kubernetes a lot more now and things like that, which is Argo Workflows, GoCD, and Tekton. Now, if you've ever heard of Argo CD, then you might know Argo Workflows. And you might also be like, well, what's the difference? One's got CD in it and one's got workflows in it.

[00:06:55]
As I said before, you separate what you're trying to do delivery-wise versus CI. CD is just about delivery, Argo Workflows is basically the CI solution for that. And so you can run it in Kubernetes natively, it's set up, really easy to use, and it's a good solution. Same thing with GoCD and Tekton.

[00:07:14]
Kubernetes, what's nice about Kubernetes is, is because of the way it's built, you can kind of get these like, whoa, massive turnkey solutions that you would expect from a provider in Kubernetes. And so that's why I put these here as well, as is I do think that if you're on Kubernetes, these might be very interesting for you as well.

[00:07:35]
What about manual scripts? No, [LAUGH] just no, don't do it, it's not recommended. Yes, it's an option, but really only if you have specific requirements for it. We are at the point now where we have nice things, and we can continue to have nice things if we want to.

[00:07:57]
As a matter of fact, it's why we can't have nice things [LAUGH] is because of the manual scripts. You can't scale them, you have to run them over and over, they're not really reliable. It makes it more challenging to be reproducible.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now