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