1 00:00:00,050 --> 00:00:00,300 ‫Okay. 2 00:00:00,380 --> 00:00:04,790 ‫Welcome to one of my favorite sections on AWS, which is the CI CD section. 3 00:00:04,820 --> 00:00:05,210 ‫Why? 4 00:00:05,240 --> 00:00:10,850 ‫Because as a developer, CI CD is so important and that section is actually really key at the exam. 5 00:00:10,970 --> 00:00:17,270 ‫So you're using before all the course resources, we've learned how to create resources manually, which 6 00:00:17,270 --> 00:00:18,390 ‫are the fundamentals. 7 00:00:18,410 --> 00:00:20,600 ‫We learn how to interact with AWS programmatically. 8 00:00:20,750 --> 00:00:25,960 ‫So otherwise using the CLI and we learn how to deploy code to using Beanstalk. 9 00:00:25,970 --> 00:00:30,650 ‫But all those steps that we're done here were very manual and it's very likely for us to do mistakes 10 00:00:30,650 --> 00:00:32,340 ‫if we keep on doing things manually. 11 00:00:32,360 --> 00:00:37,940 ‫So what we want to do, end of the day is to push our code in a target repository and then from that 12 00:00:37,940 --> 00:00:42,490 ‫code we want it to be deployed in an automated way onto AWS. 13 00:00:42,500 --> 00:00:48,170 ‫So automatically the right way, making sure that our code is going to be tested before it's being deployed 14 00:00:48,170 --> 00:00:49,910 ‫with the possibility to go into different stages. 15 00:00:49,910 --> 00:00:54,410 ‫For example, our development environment, our test environment, our staging, which is pre-prod and 16 00:00:54,410 --> 00:00:55,460 ‫prod environment. 17 00:00:55,460 --> 00:01:00,270 ‫And sometimes even when you want to deploy to prod, maybe you want to have manual approvals and so 18 00:01:00,270 --> 00:01:01,410 ‫we want all these things. 19 00:01:01,410 --> 00:01:07,620 ‫So we need to learn AWS, CI, CD, and these are very important steps because we're going to automate 20 00:01:07,620 --> 00:01:10,260 ‫all these steps and this is super important. 21 00:01:10,470 --> 00:01:16,710 ‫Okay, so it's all about automating everything we've done so far in this course to add safety and to 22 00:01:16,710 --> 00:01:17,820 ‫add speed. 23 00:01:17,820 --> 00:01:23,970 ‫So we learn about code, commit to store our code codepipeline to automate our pipelines from code to 24 00:01:23,970 --> 00:01:30,150 ‫platforms such as Beanstalk or other places code build to build and automatically test our code to code 25 00:01:30,150 --> 00:01:35,250 ‫deploy to deploy our code to EC2 instances not using beanstalk but using other ways. 26 00:01:35,280 --> 00:01:40,470 ‫Codestar which is a way for us to manage software deployment activities in one place and regroups code. 27 00:01:40,470 --> 00:01:46,260 ‫Commit Codepipeline code build and code deploy in 1 in 1 tool called artifact to store, publish and 28 00:01:46,260 --> 00:01:50,820 ‫share software packages and code guru to have automated code reviews using machine learning. 29 00:01:50,820 --> 00:01:55,380 ‫So now don't worry, we'll learn about all of this one by one in this course. 30 00:01:55,380 --> 00:01:56,690 ‫This is just an overview. 31 00:01:56,700 --> 00:01:58,470 ‫So what is CI CD? 32 00:01:58,470 --> 00:02:03,540 ‫So first CD is about continuous integration and that means that the developers are going to push the 33 00:02:03,540 --> 00:02:06,960 ‫code very often into a central code repository. 34 00:02:06,960 --> 00:02:12,920 ‫And so that could be GitHub, which is a third party service from AWS or Code Commit, which is a AWS 35 00:02:12,930 --> 00:02:15,600 ‫service or Bitbucket, which is also a third party service. 36 00:02:15,600 --> 00:02:21,120 ‫So developers push the code to a code repo and then there's going to be a test or a build server that 37 00:02:21,120 --> 00:02:25,950 ‫will check if the code is correct and working as soon as it's pushed into the code repository. 38 00:02:25,950 --> 00:02:31,200 ‫So this could be code build if it's AWS or Jenkins, if you want an open source tool, for example. 39 00:02:31,410 --> 00:02:33,810 ‫So the build server is going to fetch the code and test it. 40 00:02:33,810 --> 00:02:39,210 ‫And then as a developer, we're going to get feedback as to whether or not the test or checks will have 41 00:02:39,210 --> 00:02:39,900 ‫passed or failed. 42 00:02:39,900 --> 00:02:43,470 ‫And so we get the build and test results, but we've saved time. 43 00:02:43,470 --> 00:02:50,370 ‫So with this we find Bug early and we fix them early because we are testing the code as soon as it is 44 00:02:50,370 --> 00:02:54,540 ‫pushed in a code repository so the developer doesn't need to test the code on their machine. 45 00:02:54,540 --> 00:02:58,830 ‫They can just push the code and wait for the build server to do it while they do some other tasks. 46 00:02:58,860 --> 00:03:02,730 ‫Therefore the code is going to be delivered faster because it's going to be tested. 47 00:03:02,760 --> 00:03:06,600 ‫Thanks to this, we're going to be able to deploy often because as soon as it's tested and ready, we 48 00:03:06,600 --> 00:03:07,470 ‫can deploy it. 49 00:03:07,470 --> 00:03:12,780 ‫And then happier developers because developers have a healthier cycle for development. 50 00:03:12,930 --> 00:03:18,210 ‫So we saw CI and now there is CD, so it could be continuous delivery, for example. 51 00:03:18,210 --> 00:03:20,220 ‫And so let's give you this example. 52 00:03:20,220 --> 00:03:26,340 ‫So here we have application servers of version one and we want our code as a developer to be pushed 53 00:03:26,340 --> 00:03:28,410 ‫all the way to these application servers. 54 00:03:28,410 --> 00:03:33,210 ‫So the way we do it is that with continuous delivery, anytime we push the code onto the code repo, 55 00:03:33,240 --> 00:03:34,770 ‫it's going to be deployed. 56 00:03:34,770 --> 00:03:38,160 ‫If it's tested appropriately onto our application servers. 57 00:03:38,160 --> 00:03:42,270 ‫So the developer pushes the code, the code is going to be tested by the build server. 58 00:03:42,270 --> 00:03:44,670 ‫So this is the continuous integration part. 59 00:03:44,670 --> 00:03:50,460 ‫And then after the build is passed, so it's green, so it's fully tested, then there's going to be 60 00:03:50,460 --> 00:03:55,050 ‫a deployment server and this deployment server is going to deploy our application onto our application 61 00:03:55,050 --> 00:03:55,740 ‫servers. 62 00:03:55,740 --> 00:03:57,120 ‫So version one at first. 63 00:03:57,120 --> 00:04:02,790 ‫But then if we push again a new version of our code into our code repo, then we're going to have application 64 00:04:02,790 --> 00:04:04,110 ‫server version two. 65 00:04:04,230 --> 00:04:08,940 ‫So with continuous delivery, we ensure that the deployments happen often and that they're very quick 66 00:04:08,940 --> 00:04:14,460 ‫and we shift away from a mentality of let's do one release every three months, which is very long to 67 00:04:14,460 --> 00:04:20,310 ‫do, you know, error prone because it doesn't happen very often to let's automate, you know, up to 68 00:04:20,310 --> 00:04:24,540 ‫five releases a day because every time we push the code into the code repo, the code is going to be 69 00:04:24,540 --> 00:04:26,850 ‫live onto some application servers. 70 00:04:26,850 --> 00:04:32,100 ‫So to do continuous delivery, we need automated deployment tools such as code deploy, which is an 71 00:04:32,310 --> 00:04:35,940 ‫AWS service or Jenkins CD or Spinnaker or other tools. 72 00:04:36,150 --> 00:04:41,730 ‫So if we look at the tech stack for CI CD on AWS, we have the code and the code can live in Codecommit 73 00:04:41,760 --> 00:04:45,330 ‫or GitHub or Bitbucket or any third party code repository. 74 00:04:45,510 --> 00:04:47,520 ‫Then we have a build phase. 75 00:04:47,520 --> 00:04:52,650 ‫So the build phase and the test phase could be done by code build on AWS, but there's a competitor 76 00:04:52,650 --> 00:04:58,380 ‫to code build which is open source called Jenkins CI or any third party CI server will do as well. 77 00:04:58,500 --> 00:04:59,730 ‫Then we go to the deploy. 78 00:05:00,290 --> 00:05:02,450 ‫Then we can use code, deploy and code deploy will see. 79 00:05:02,450 --> 00:05:08,690 ‫You can deploy to EC2 instances on premises, servers, lambda functions and ECS or if you wanted to 80 00:05:08,690 --> 00:05:13,970 ‫also provision the infrastructure, we could use elastic beanstalk as an alternative to code deploy 81 00:05:13,970 --> 00:05:19,760 ‫to do the deployment and the provision of the infrastructure, and then to orchestrate all these things 82 00:05:19,760 --> 00:05:22,990 ‫to define exactly what happens in our CI CD process. 83 00:05:23,000 --> 00:05:26,600 ‫Then we can orchestrate everything using AWS code pipeline. 84 00:05:26,600 --> 00:05:28,490 ‫So that's it for an overview of CI CD. 85 00:05:28,500 --> 00:05:33,530 ‫Now in this section we're going to do a deep dive obviously on the services, but hopefully you know 86 00:05:33,530 --> 00:05:35,240 ‫the context of what we're trying to do now. 87 00:05:35,240 --> 00:05:37,610 ‫Let's go ahead and do a deep dive on all these services. 88 00:05:37,610 --> 00:05:39,410 ‫So I will see you in the next lecture.