Instructor: CI/CD. 2 2
In this lesson, we're going to talk about three concepts. 3 3
This is known as continuous integration, 4 4
continuous delivery, and continuous deployment. 5 5
Before we do that though, we really have to take a look back 6 6
to the way that code is made 7 7
and deployed in most of our environments. 8 8
Now, in the old days 9 9
the way we would do things is very linearly. 10 10
We would start out with development, 11 11
and we would start taking the code 12 12
and putting it together and figure out what it's going to do. 13 13
Then we would move into testing and integration 14 14
where we would put it into some kind of a test environment 15 15
and make sure it didn't break anything. 16 16
After that, we would start the integration process, 17 17
which means we might be buying new servers 18 18
and we might start installing all the software 19 19
to see how it's going to operate in that full environment. 20 20
After that, we'd move into staging. 21 21
Now, staging is where we'd actually put things 22 22
into a set of servers that look like 23 23
our production environment, 24 24
getting ready to move from testing into staging 25 25
and then from staging into production. 26 26
Which brings us to our final step, which is production. 27 27
This is when that piece of software is actually deployed 28 28
onto those servers that are being used by your end users. 29 29
Now, this was a very slow process 30 30
especially if you did it one step after another, 31 31
and the challenging thing 32 32
is that these steps were all run by different people. 33 33
So when you had developers, that was your programmers, 34 34
they had one role, and then they would send it over 35 35
to another team who did testing, and then they would send it 36 36
to another team that did integration and staging. 37 37
And finally, you had the operations folks 38 38
who took it from staging into production. 39 39
And so there was a lot of handovers 40 40
and a lot of problems here 41 41
because things were moving from one step to another, 42 42
and there'd be a lot of internal conflict 43 43
within your organization. 44 44
Now, the concepts involved with CI/CD 45 45
tries to eliminate a lot of that. 46 46
It tries to speed this process up. 47 47
For instance, I worked at one organization 48 48
where when we wanted to add a new feature 49 49
it could take nine to 12 months 50 50
to go from development all the way through to production. 51 51
So instead, with continuous integration workflows 52 52
you can actually speed this process up a lot. 53 53
When you're dealing with continuous integration workflows 54 54
you have a common source repository. 55 55
Everyone ends up checking in their code 56 56
to this common source. 57 57
Now, this can be your managers, your developers, 58 58
whoever's working on it. 59 59
Then when you're ready to get this thing running 60 60
you can take it from that common source 61 61
and pull it into the continuous integration server. 62 62
At that point, it gets built. 63 63
That means it compiles the code, it tests the code, 64 64
and then it tells you whether or not it succeeded 65 65
or it failed. 66 66
And then based on that, it can go back to the developers 67 67
for the next step, which might be moving into testing, 68 68
moving into integration, moving into staging, 69 69
moving into production. 70 70
But by doing this, you can automate a lot of this function. 71 71
So when we talk about continuous integration 72 72
this is this first piece of this. 73 73
Continuous integration is a software development method 74 74
where code updates are tested and committed 75 75
to a development or build server or code repository rapidly. 76 76
So this allows us to create something, test it, 77 77
and then once we know it's good, we can say this is ready 78 78
to be implemented in the environment. 79 79
Now, by itself, continuous integration 80 80
doesn't do that much for us in terms of speeding things up. 81 81
Yes, we are shifting left a little bit here, 82 82
and we're letting our developers do some more of the testing 83 83
which is always a good thing. 84 84
But continuous integration can do more than that. 85 85
By using continuous integration, you can actually test 86 86
and commit updates multiple times per day. 87 87
So going from that feature, taking nine to 12 months, 88 88
we can now have systems where we're doing 89 89
continuous integration 5, 10, 20 times a day if needed. 90 90
Now, how do we get that fast though? 91 91
Well, that's where we have to bring in 92 92
continuous delivery and continuous deployment. 93 93
Now, when I talk about continuous integration, 94 94
it's really focused on detecting and resolving 95 95
development conflicts early and often. 96 96
So remember I said here in the workflow, 97 97
we have all of our developers 98 98
who are using the same sources. 99 99
Well, if I'm doing something where I take a big feature 100 100
and it takes a hundred developers to work on it, 101 101
that's a hundred different people making changes to code. 102 102
If they're all working on it, 103 103
and they're working on these things, 104 104
and they're checking out for maybe a week at a time 105 105
or two weeks at a time, 106 106
that causes divergences from what we started with a week ago 107 107
to where we are a week later. 108 108
Because as you're working on something 109 109
and I'm working on something for a whole week, 110 110
that means we have a lot of differences. 111 111
So instead, with continuous integration 112 112
we're constantly taking our code, 113 113
we're doing these integrations, we're testing it, 114 114
and then putting it back to the master. 115 115
So we're all working from the same sheet of music. 116 116
This way, we're making sure we don't have these big changes 117 117
and these big conflicts. 118 118
Now, if we want to take this a step further, 119 119
we can actually start speeding up the delivery of things 120 120
and this is known as continuous delivery. 121 121
Now, if you're going to do continuous delivery 122 122
you have to do continuous integration, 123 123
but just because you're doing continuous integration 124 124
doesn't mean you're doing continuous delivery. 125 125
These things are not A equals B, and B equals A. 126 126
It's more like if you have A, you can do B, 127 127
but if you have B, you must be doing A. 128 128
Now, when I talk about continuous delivery 129 129
this is a software development method 130 130
where the application and platform requirements 131 131
are frequently tested and validated 132 132
for immediate availability. 133 133
So, I go out and I code some new feature. 134 134
I test it through continuous integration. 135 135
Now that I've tested it, 136 136
I can go through continuous delivery 137 137
which means it's going to go through all the tests, 138 138
all the compliance, and all the validations. 139 139
So it's now ready to be installed 140 140
on that staging server or into production. 141 141
Now, I'm not actually going to go forward 142 142
and install it on staging 143 143
or install it on the production server, 144 144
that's not continuous delivery, 145 145
that is continuous deployment. 146 146
Now with continuous deployment, we take the concept 147 147
of continuous integration and continuous delivery 148 148
and we take it even one step further. 149 149
Now we have a software development model 150 150
where application and platform updates 151 151
are committed to production rapidly. 152 152
Essentially, I'm going to create some new piece of code 153 153
maybe a security fix, 154 154
it's going to go through the integration testing. 155 155
Once that's been approved 156 156
it goes back to the code repository. 157 157
At that point, we can go through 158 158
and do continuous deployment where it gets tested 159 159
and ready to go into staging. 160 160
But instead of just sitting there waiting for somebody 161 161
to actually install it in staging 162 162
with continuous deployment, 163 163
we can take that code and actually deploy it to staging 164 164
and then at regular intervals 165 165
move things from staging into production. 166 166
This allows us to do things much quicker 167 167
in terms of deployment and release cycles. 168 168
Now, when we talk about continuous delivery, 169 169
I want you to remember that continuous delivery 170 170
is focused on automated testing of code 171 171
in order to get it ready for release, not released, 172 172
just ready for release. 173 173
Now when I talk about continuous deployment, 174 174
I'm taking it a step further. 175 175
I'm focusing on automated testing 176 176
and the release of code 177 177
in order to get it into the production environment 178 178
much more quickly. 179 179
Now, what are the real big benefits here? 180 180
Well, think about it like this. 181 181
If you're dealing with something like coding a security fix, 182 182
do you want to take three weeks, or three months, 183 183
or three years to get it out there? 184 184
No, you want it out there right now. 185 185
And so by doing continuous integration, 186 186
continuous delivery, and continuous deployment, 187 187
you can shorten that cycle and get things out today 188 188
or even within a couple of hours. 189 189
Now for the exam, these concepts 190 190
are just a few quick topics that we need to cover 191 191
but you're really unlikely to get many questions 192 192
on these during the exam. 193 193
This is really much more focused 194 194
on software development lifecycle and things of that nature. 195 195
If you get into IT Service Management 196 196
and you start working in DevSecOps, 197 197
you'll probably become very familiar with these terms. 198 198
But for now, I just wanted you to be introduced to that, 199 199
to the way that code is made 200 200
and deployed in most of our environments.