1 00:00:00,120 --> 00:00:01,790 ‫Okay, so let's learn about CodeCommit. 2 00:00:01,790 --> 00:00:04,840 ‫So I'm just going to open the CodeCommit console. 3 00:00:04,840 --> 00:00:07,500 ‫So in this CodeCommit, as we see on the left hand side, 4 00:00:07,500 --> 00:00:10,560 ‫we have access to CodeCommit, CodeBuild, CodeDeploy, 5 00:00:10,560 --> 00:00:12,950 ‫and CodePipeline all in one UI. 6 00:00:12,950 --> 00:00:15,360 ‫So right now we'll be starting with CodeCommits. 7 00:00:15,360 --> 00:00:17,510 ‫So I currently have no repositories. 8 00:00:17,510 --> 00:00:19,850 ‫So let's get started in create a repository. 9 00:00:19,850 --> 00:00:24,240 ‫And I will just call it my-nodejs.app. 10 00:00:24,240 --> 00:00:25,860 ‫You could add description and tags, 11 00:00:25,860 --> 00:00:26,750 ‫but we'll just go ahead 12 00:00:26,750 --> 00:00:29,520 ‫and create our odeCommit repository. 13 00:00:29,520 --> 00:00:33,070 ‫So here we are riched with connection steps. 14 00:00:33,070 --> 00:00:37,970 ‫And so as we can see, we have HTTPS, SSH or HTTPS GRC. 15 00:00:37,970 --> 00:00:40,750 ‫And here, if you don't see SSH, 16 00:00:40,750 --> 00:00:42,620 ‫that means you're not connected using the roots, 17 00:00:42,620 --> 00:00:43,890 ‫you're connect to using the root account 18 00:00:43,890 --> 00:00:45,390 ‫and not using an IAM User. 19 00:00:45,390 --> 00:00:46,223 ‫So in this example, 20 00:00:46,223 --> 00:00:48,220 ‫I'm connected using my IAM Users defined. 21 00:00:48,220 --> 00:00:50,700 ‫And so if you're using root, you will not see SSH, 22 00:00:50,700 --> 00:00:52,970 ‫but if you're not using root, you should see SSH. 23 00:00:52,970 --> 00:00:54,850 ‫Okay, so right now, 24 00:00:54,850 --> 00:00:56,720 ‫we will not go over the connection steps, 25 00:00:56,720 --> 00:00:58,940 ‫we'll go over that in the next lecture. 26 00:00:58,940 --> 00:00:59,940 ‫So right now what we're to do, 27 00:00:59,940 --> 00:01:01,860 ‫is to explore the CodeCommit UI. 28 00:01:01,860 --> 00:01:04,860 ‫So let's go into the code. 29 00:01:04,860 --> 00:01:07,250 ‫And here is my-nodejs-application. 30 00:01:07,250 --> 00:01:09,980 ‫And what we can do is we can create a file. 31 00:01:09,980 --> 00:01:13,580 ‫So we'll add a file, and I will upload a file. 32 00:01:13,580 --> 00:01:15,390 ‫And I need to choose a file to upload. 33 00:01:15,390 --> 00:01:17,750 ‫So currently, we can only do one file at a time. 34 00:01:17,750 --> 00:01:21,287 ‫So I'm gonna go to my code, and then go to CICD, 35 00:01:21,287 --> 00:01:24,750 ‫nodejs-v2-blue and choose the index of HTML file, 36 00:01:24,750 --> 00:01:26,000 ‫we had from before. 37 00:01:26,000 --> 00:01:27,810 ‫So we're going to upload that file, 38 00:01:27,810 --> 00:01:29,490 ‫the author name is Stephane 39 00:01:29,490 --> 00:01:32,900 ‫and the email address is stephane@example.com. 40 00:01:32,900 --> 00:01:35,390 ‫And the commit message is first commit. 41 00:01:35,390 --> 00:01:37,640 ‫Then I'm going to click on commit changes 42 00:01:37,640 --> 00:01:41,243 ‫and this will create my first AWS CodeCommit commit. 43 00:01:41,243 --> 00:01:42,380 ‫So as you can see, now, 44 00:01:42,380 --> 00:01:45,810 ‫my repository has the index.html file in it, 45 00:01:45,810 --> 00:01:48,850 ‫which is the one we use from before in Elastic Beanstalk. 46 00:01:48,850 --> 00:01:51,170 ‫And we know it is the one because if we scroll down, 47 00:01:51,170 --> 00:01:53,450 ‫we can look at the fact that the background color, 48 00:01:53,450 --> 00:01:54,600 ‫is navy blue. 49 00:01:54,600 --> 00:01:56,920 ‫So it has created a commit with a commit ID 50 00:01:56,920 --> 00:01:59,190 ‫and this is something specific to get. 51 00:01:59,190 --> 00:02:01,350 ‫And the commit has been done onto a branch, 52 00:02:01,350 --> 00:02:03,090 ‫and that branch is called master. 53 00:02:03,090 --> 00:02:04,870 ‫And so this is why it says master here, 54 00:02:04,870 --> 00:02:05,890 ‫it is the default branch 55 00:02:05,890 --> 00:02:07,550 ‫and the first branch to get created. 56 00:02:07,550 --> 00:02:08,880 ‫But in CodeCommit, 57 00:02:08,880 --> 00:02:10,590 ‫you can go ahead and create more branches, 58 00:02:10,590 --> 00:02:13,130 ‫if you want developers to collaborate together. 59 00:02:13,130 --> 00:02:14,270 ‫So right now we're good. 60 00:02:14,270 --> 00:02:16,720 ‫We have a repository my-nodejs-app, 61 00:02:16,720 --> 00:02:19,090 ‫and it contains an index.html. 62 00:02:19,090 --> 00:02:21,340 ‫Now let's go over the options in CodeCommits. 63 00:02:22,200 --> 00:02:24,060 ‫So the first one is pull request, 64 00:02:24,060 --> 00:02:26,770 ‫and pull request is to allow developers 65 00:02:26,770 --> 00:02:30,120 ‫to merge their changes from a different branch, 66 00:02:30,120 --> 00:02:32,450 ‫into your master branch, for example. 67 00:02:32,450 --> 00:02:34,080 ‫So you would need to create a pull request, 68 00:02:34,080 --> 00:02:34,913 ‫we're not going to do this, 69 00:02:34,913 --> 00:02:36,340 ‫this is more advanced something you need to know, 70 00:02:36,340 --> 00:02:37,730 ‫in the DevOps exam. 71 00:02:37,730 --> 00:02:38,680 ‫But pull requests are here 72 00:02:38,680 --> 00:02:41,190 ‫to help you merge your changes, 73 00:02:41,190 --> 00:02:43,760 ‫from other branches into your main branch. 74 00:02:43,760 --> 00:02:45,020 ‫Then here on the left hand side, 75 00:02:45,020 --> 00:02:46,160 ‫you can look at your commits. 76 00:02:46,160 --> 00:02:48,530 ‫So we can see we did our first commit right here, 77 00:02:48,530 --> 00:02:50,600 ‫and we can browse the repository at the time 78 00:02:50,600 --> 00:02:51,730 ‫of this commits. 79 00:02:51,730 --> 00:02:54,500 ‫Or we can look at a Commit Visualizer. 80 00:02:54,500 --> 00:02:55,800 ‫So if you had multiple commits, 81 00:02:55,800 --> 00:02:57,140 ‫they would appear here 82 00:02:57,140 --> 00:02:59,640 ‫and also Compare commits if you wanted to compare, 83 00:02:59,640 --> 00:03:02,070 ‫a certain branch to another branch. 84 00:03:02,070 --> 00:03:04,060 ‫Okay, next let's talk about branches. 85 00:03:04,060 --> 00:03:06,040 ‫So currently, we only have the master branch, 86 00:03:06,040 --> 00:03:07,600 ‫and it is the default branch. 87 00:03:07,600 --> 00:03:09,590 ‫And we could go ahead and create another branch, 88 00:03:09,590 --> 00:03:11,280 ‫if we wanted to call it for example, 89 00:03:11,280 --> 00:03:14,240 ‫the dev branch or the test branch or whatever you want, 90 00:03:14,240 --> 00:03:15,380 ‫and where to branch it from. 91 00:03:15,380 --> 00:03:18,460 ‫So you would create a dev branch, branch out of master, 92 00:03:18,460 --> 00:03:19,920 ‫I'm not going to do this, is more advanced. 93 00:03:19,920 --> 00:03:22,040 ‫Right now we'll keep on doing this tutorial, 94 00:03:22,040 --> 00:03:24,020 ‫with only the master branch. 95 00:03:24,020 --> 00:03:26,590 ‫Get tags is something we're not using right now, 96 00:03:26,590 --> 00:03:28,010 ‫so we'll just skip it. 97 00:03:28,010 --> 00:03:29,830 ‫And finally, settings. 98 00:03:29,830 --> 00:03:31,190 ‫So let's go over the settings. 99 00:03:31,190 --> 00:03:35,290 ‫Here, we can find our repository name, the ID and the ARN, 100 00:03:35,290 --> 00:03:36,710 ‫as well as the description. 101 00:03:36,710 --> 00:03:38,720 ‫Then we can go into notifications, 102 00:03:38,720 --> 00:03:39,920 ‫and this is important. 103 00:03:39,920 --> 00:03:42,030 ‫This is where we will create notification rules, 104 00:03:42,030 --> 00:03:44,120 ‫for our code repository. 105 00:03:44,120 --> 00:03:46,380 ‫So let's go ahead and create a notification rule. 106 00:03:46,380 --> 00:03:48,823 ‫We're just going to give it DemoNotificationRule. 107 00:03:49,820 --> 00:03:52,570 ‫And then whatever details we want in the notification, 108 00:03:52,570 --> 00:03:54,570 ‫it could be full to get the full information 109 00:03:54,570 --> 00:03:56,880 ‫or basic to get some basic information. 110 00:03:56,880 --> 00:03:58,690 ‫It doesn't matter, we'll just keep it as full 111 00:03:58,690 --> 00:04:01,740 ‫and then the events that will trigger these notifications. 112 00:04:01,740 --> 00:04:04,610 ‫So we can get to comments on commits on a pull request. 113 00:04:04,610 --> 00:04:07,370 ‫Approval status to Status change and Rule override. 114 00:04:07,370 --> 00:04:09,960 ‫Pull request, so whenever the source was updated, created, 115 00:04:09,960 --> 00:04:11,740 ‫status changed or merged, 116 00:04:11,740 --> 00:04:14,920 ‫and branches and tags are created, deleted and updated. 117 00:04:14,920 --> 00:04:17,260 ‫So these represents some changes happening, 118 00:04:17,260 --> 00:04:19,200 ‫on your CodeCommit repository, 119 00:04:19,200 --> 00:04:22,090 ‫you could go ahead and click on Select all to of them all. 120 00:04:22,090 --> 00:04:23,670 ‫And then you just select a target 121 00:04:23,670 --> 00:04:25,310 ‫of these notification rule. 122 00:04:25,310 --> 00:04:27,520 ‫So it could be an SNS topic 123 00:04:27,520 --> 00:04:30,450 ‫or Chakbox Slack and you can create another target. 124 00:04:30,450 --> 00:04:32,990 ‫So we can create an SNS topic or a chatbot Slack, 125 00:04:32,990 --> 00:04:34,680 ‫will keep it as SNS topic, 126 00:04:34,680 --> 00:04:37,600 ‫and it has to start with codestar-notification, I think, 127 00:04:37,600 --> 00:04:38,920 ‫and then you can rename it. 128 00:04:38,920 --> 00:04:42,090 ‫So I'll just call call it codecommit. 129 00:04:42,090 --> 00:04:44,780 ‫And then the name is going to be lab, 130 00:04:44,780 --> 00:04:46,810 ‫something like this codecommit-lab. 131 00:04:46,810 --> 00:04:49,690 ‫And here we go, I can create this SNS topic. 132 00:04:49,690 --> 00:04:52,870 ‫And so this is a topic that will be notified whenever any 133 00:04:52,870 --> 00:04:54,430 ‫of these things happen. 134 00:04:54,430 --> 00:04:56,410 ‫And an SNS topic will help us for example, 135 00:04:56,410 --> 00:04:59,010 ‫trigger an email alert or something like this. 136 00:04:59,010 --> 00:05:01,000 ‫Okay, we'll click on submits. 137 00:05:01,000 --> 00:05:03,680 ‫And here we go, we have created our first notification rule. 138 00:05:03,680 --> 00:05:06,740 ‫And we can look at the settings here, edit it or delete it. 139 00:05:06,740 --> 00:05:08,040 ‫But right now we're good. 140 00:05:08,040 --> 00:05:10,210 ‫We'll go to View notification rules. 141 00:05:10,210 --> 00:05:12,950 ‫Okay, excellent, and they are on the left hand side, 142 00:05:12,950 --> 00:05:13,870 ‫under the settings. 143 00:05:13,870 --> 00:05:15,870 ‫So to go back to our CodeCommit, 144 00:05:15,870 --> 00:05:19,940 ‫we need to go into Source, Repositories, and then in here, 145 00:05:19,940 --> 00:05:23,190 ‫and we are able to go on the left hand side to settings 146 00:05:23,190 --> 00:05:25,090 ‫and get back to our Notifications. 147 00:05:25,090 --> 00:05:27,120 ‫Okay, so we're good to go. 148 00:05:27,120 --> 00:05:28,490 ‫Next is a Trigger. 149 00:05:28,490 --> 00:05:31,743 ‫So we can create a trigger, and I'll call it DemoTrigger. 150 00:05:32,720 --> 00:05:36,690 ‫And the triggers are more on specific actual code events. 151 00:05:36,690 --> 00:05:39,440 ‫So we can have push to existing branch, 152 00:05:39,440 --> 00:05:40,273 ‫create branch or tag 153 00:05:40,273 --> 00:05:42,900 ‫or delete branch or tag that is a bit of overlap, 154 00:05:42,900 --> 00:05:44,040 ‫based on the notification rules, 155 00:05:44,040 --> 00:05:46,990 ‫but push to existing branch for example, is something new. 156 00:05:46,990 --> 00:05:49,430 ‫You can specify the branches name, for example, master. 157 00:05:49,430 --> 00:05:51,360 ‫And again, the service you want 158 00:05:51,360 --> 00:05:53,780 ‫to trigger based on these events. 159 00:05:53,780 --> 00:05:54,790 ‫So would it be SNS 160 00:05:54,790 --> 00:05:57,130 ‫and we can choose the exact same SNS topic 161 00:05:57,130 --> 00:05:59,500 ‫or a Lambda function when we get to see Lambda. 162 00:05:59,500 --> 00:06:01,300 ‫So just create rate the trigger. 163 00:06:01,300 --> 00:06:03,600 ‫And here we go, we have created a different trigger, 164 00:06:03,600 --> 00:06:04,930 ‫that will be sending a notification 165 00:06:04,930 --> 00:06:06,580 ‫to SNS whenever something happens, 166 00:06:06,580 --> 00:06:08,380 ‫in our CodeCommit repository. 167 00:06:08,380 --> 00:06:10,610 ‫Finally, Repository tags which should be tags, 168 00:06:10,610 --> 00:06:13,210 ‫if you wanted to tag a repo, but for now, we won't do it. 169 00:06:13,210 --> 00:06:14,120 ‫And that's all. 170 00:06:14,120 --> 00:06:16,790 ‫So right now we've just pushed some information 171 00:06:16,790 --> 00:06:19,340 ‫and some files into our CodeCommit repository. 172 00:06:19,340 --> 00:06:21,680 ‫In the next lecture, we'll be setting up our credentials 173 00:06:21,680 --> 00:06:23,740 ‫to have a way to do this programmatically. 174 00:06:23,740 --> 00:06:25,590 ‫So we'll see you in the next lecture.