1 00:00:01,350 --> 00:00:05,720 Hopefully you have now successfully installed scaffold to make sure that it is installed successfully. 2 00:00:05,730 --> 00:00:10,520 Going to open up my terminal and just run the command scaffold if you run that command. 3 00:00:10,520 --> 00:00:13,250 You should see a bunch of health information like this right here. 4 00:00:13,310 --> 00:00:17,930 If you see something says command not recognized well you need to double check your scaffold installation 5 00:00:19,110 --> 00:00:20,760 now that we've got scaffold installed. 6 00:00:20,760 --> 00:00:24,240 We are going to configure it by writing out yet another config file. 7 00:00:24,330 --> 00:00:29,220 This can pick violent is going to tell scaffold how to manage all the different sub projects inside 8 00:00:29,220 --> 00:00:31,710 of our cluster inside of my code. 9 00:00:31,720 --> 00:00:36,680 Ed I'm gonna find my root project directory and I'm gonna create a new file inside there called scaffold 10 00:00:37,010 --> 00:00:42,080 thought Amel the config that we're going to write inside of here is going to look rather similar to 11 00:00:42,080 --> 00:00:47,150 a lot of the configuration that we've already written to apply to a Cuban is cluster but everything 12 00:00:47,150 --> 00:00:51,920 we write inside of here does not get applied to Cuba net is instead it is just consumed by scaffold 13 00:00:51,920 --> 00:00:59,740 directly and scaffold is a tool that runs outside of our cluster so let's start to write out some configuration 14 00:01:00,460 --> 00:01:03,340 allow the scaffold files we're gonna write are gonna be just about identical. 15 00:01:03,370 --> 00:01:07,930 So this is another scenario where you pretty much just learn it once and then start to kind of copy 16 00:01:07,930 --> 00:01:10,630 paste stuff around when appropriate. 17 00:01:10,630 --> 00:01:19,710 All right so we're gonna write out API version scaffold B2 Alpha 3 I'm gonna put it in a kind of config 18 00:01:21,210 --> 00:01:29,190 a deploy with a nested cube Seitel a nested manifests and then we're going to put in an array entry 19 00:01:29,250 --> 00:01:38,460 which means a little dash and then dot slash infra AIDS star so this versatile bit of config right here 20 00:01:38,580 --> 00:01:42,760 or this really is our first important piece of config is what I should say. 21 00:01:42,990 --> 00:01:48,660 This is telling a scaffold that there is a collection of different config files intended for Cuban entities 22 00:01:48,930 --> 00:01:51,900 inside of the infra K AIDS directory. 23 00:01:51,900 --> 00:01:56,820 So by adding in this manifest line we are telling scaffold that we wanted to watch all these different 24 00:01:56,850 --> 00:01:58,410 e-mail files. 25 00:01:58,560 --> 00:02:04,170 Anytime that we make a change to one of those files scaffold is going to automatically reapply that 26 00:02:04,170 --> 00:02:06,430 config file to our Cuban days cluster. 27 00:02:06,450 --> 00:02:12,060 So in other words it's gonna save us from the hassle of having to run UCL apply dash F over and over 28 00:02:12,060 --> 00:02:19,780 and over again any time that we create a file or make a change to a file by listing out manifests scaffold 29 00:02:19,780 --> 00:02:24,960 is also going to make sure to create all these or apply all these anytime that we start scaffold up. 30 00:02:25,450 --> 00:02:30,790 It's also going to delete all the config or all the objects associated with these config files whenever 31 00:02:30,790 --> 00:02:32,420 we stop scaffold as well. 32 00:02:32,500 --> 00:02:34,580 So in total this is really doing three things. 33 00:02:34,630 --> 00:02:38,370 We start up scaffold apply these files when we make a change. 34 00:02:38,380 --> 00:02:45,730 Apply these files whenever we stop scaffold find all the objects related to these config files and delete 35 00:02:45,730 --> 00:02:45,940 them. 36 00:02:45,940 --> 00:02:50,410 Don't delete the files themselves just delete the objects that are created by them inside our communities 37 00:02:50,410 --> 00:02:51,700 cluster. 38 00:02:51,700 --> 00:02:55,720 This is really the part where this is fantastic for working between different projects because whenever 39 00:02:55,720 --> 00:02:58,660 we start up scaffold we're going to apply all these objects. 40 00:02:58,660 --> 00:03:03,340 Whenever we stop scaffold to go work on another project all the objects related to these will be deleted 41 00:03:03,370 --> 00:03:07,180 and we'll end up with a relatively clean cluster. 42 00:03:07,220 --> 00:03:09,450 So that's part one of our config file. 43 00:03:09,470 --> 00:03:18,480 Now onto step 2 We're gonna put in a build local push of false so I default whenever scaffold makes 44 00:03:18,480 --> 00:03:23,090 a change to one of our images or rebuild an image that's going to try to push it up to Docker Hub. 45 00:03:23,160 --> 00:03:28,020 That is not actually required when we're using scaffold so we're going to disable that default behavior 46 00:03:28,200 --> 00:03:29,480 with the setting right here. 47 00:03:30,650 --> 00:03:36,180 Next up is artifacts and I've got a typo in their artifacts. 48 00:03:36,220 --> 00:03:38,730 Make sure you got the right spelling. 49 00:03:38,750 --> 00:03:40,060 This is going to be an array. 50 00:03:40,160 --> 00:03:43,750 We're going to write out one array entry and we'll discuss what it is doing. 51 00:03:43,790 --> 00:03:46,890 I'm gonna put an image of my doc right. 52 00:03:46,940 --> 00:03:48,740 So for you it should be your doc right. 53 00:03:48,780 --> 00:03:58,760 Flash client well then put in a context of client I'll put in Docker with nested Docker file and the 54 00:03:58,760 --> 00:04:09,560 value of that is going to be a docker file with a capital D then put it in sync manual in a rate entry 55 00:04:10,930 --> 00:04:21,640 a source that is gonna be a string of S or C star star flash star dot J.S. with a DST or destination 56 00:04:21,670 --> 00:04:24,070 of period OK. 57 00:04:24,100 --> 00:04:29,680 So what is this all about this artifact section is telling scaffold about something inside of a project 58 00:04:29,680 --> 00:04:34,870 that it needs to maintain essentially saying that there is going to be some pod that is running code 59 00:04:35,140 --> 00:04:41,140 out of the client directory inside of our project so in this case client directory right here. 60 00:04:42,210 --> 00:04:48,390 Whenever something changes inside this directory scaffold is going to try to take those changes and 61 00:04:48,390 --> 00:04:48,950 somehow. 62 00:04:48,990 --> 00:04:50,280 Update our pod. 63 00:04:50,550 --> 00:04:53,770 There are two ways in which scaffold is going to try to update our pod. 64 00:04:53,790 --> 00:04:59,310 First off if we make a change to a javascript file as indicated by this little match right here. 65 00:04:59,310 --> 00:05:04,620 If we make a change to a javascript file then scaffold is going to try to take that change file and 66 00:05:04,620 --> 00:05:06,780 just directly throw it into our pod. 67 00:05:07,050 --> 00:05:11,570 That's going to literally take that file we updated and copy it directly into the pot itself. 68 00:05:11,640 --> 00:05:15,050 So our pod is going to always have the latest code inside of it. 69 00:05:15,330 --> 00:05:20,480 If we ever make a change to anything inside this client directory that is not matched up by this S.R. 70 00:05:20,500 --> 00:05:26,280 C or this entire little rural right here then scaffold is going to instead try to rebuild the entire 71 00:05:26,280 --> 00:05:27,500 image. 72 00:05:27,510 --> 00:05:32,670 So for example imagine if we installed a new dependency into our client project whenever we install 73 00:05:32,670 --> 00:05:35,850 a new dependency that's going to update our package not just on file. 74 00:05:35,850 --> 00:05:40,200 Technically package lock and technically node modules as well but basically it is making a change to 75 00:05:40,200 --> 00:05:42,950 our project that is not changing a javascript file. 76 00:05:43,610 --> 00:05:47,820 So because we made a change to a file that is not matching up to little match right here. 77 00:05:47,820 --> 00:05:55,150 Scaffold is going to decide to completely rebuild our image and update the deployment tied to it though 78 00:05:55,150 --> 00:05:56,600 it's going to rebuild this image. 79 00:05:56,740 --> 00:06:00,700 It's going to use this client directory as the source of the image. 80 00:06:00,790 --> 00:06:06,180 Once the image is built it's going to throw it as the update into our cluster those are the two things 81 00:06:06,180 --> 00:06:08,130 that this big roll right here is really doing. 82 00:06:08,130 --> 00:06:14,530 Either update these files in place or if it's a different file rebuild the entire image so we're now 83 00:06:14,530 --> 00:06:19,660 going to go through and essentially duplicate this rule for all of our other little set projects inside 84 00:06:19,660 --> 00:06:20,320 of here. 85 00:06:20,330 --> 00:06:29,130 So for comments event US moderation posts and query I'm going to copy this rule rather than just rewrite 86 00:06:29,160 --> 00:06:30,600 all of it. 87 00:06:30,600 --> 00:06:34,350 Now when you copy this stuff you might have a little bit of automatic formatting kick in. 88 00:06:34,350 --> 00:06:35,850 I definitely did. 89 00:06:36,570 --> 00:06:36,930 Let's see. 90 00:06:36,960 --> 00:06:42,240 So if you get that automatic formatting and you tried to fix the indentation just make sure you don't 91 00:06:42,240 --> 00:06:45,020 mess up any of the previous stuff as I just did right there. 92 00:06:46,880 --> 00:06:48,000 You should have something like this. 93 00:06:48,000 --> 00:06:51,700 We should see it Dash image and then dash the image down there. 94 00:06:51,720 --> 00:06:54,070 Make sure you got the right indentation as well. 95 00:06:54,160 --> 00:06:57,290 So now we will update this block for the comments. 96 00:06:57,300 --> 00:07:00,900 So this image is called your doctor I.D. such comments. 97 00:07:00,900 --> 00:07:02,400 The context is comments. 98 00:07:02,430 --> 00:07:06,960 Same Docker file but in this case our files thinking is gonna be a little bit different. 99 00:07:06,990 --> 00:07:13,380 Remember only the react application had an S RC directory everything else so say comments moderation 100 00:07:13,400 --> 00:07:14,360 et cetera. 101 00:07:14,850 --> 00:07:20,190 No s RC directory we only have a direct index dot J S file inside there so we will update that little 102 00:07:20,190 --> 00:07:27,080 selector to be just start off J J.S. like so make sure you get that update on s our C and we're going 103 00:07:27,080 --> 00:07:32,040 to once again copy this thing. 104 00:07:32,250 --> 00:07:34,200 I'll make sure I fix up the indentation 105 00:07:39,590 --> 00:07:46,660 Aereo though again makes you got the correct indentation and on this next one will update for event 106 00:07:46,690 --> 00:07:58,100 dash bus so update 1 update 2 OK next one I'll do another paste in a fix my indentation again 107 00:08:01,660 --> 00:08:08,440 there's event bus right above here's the copy paste I just put in this one I will make for this one 108 00:08:08,440 --> 00:08:10,750 I'm going to make or moderation 109 00:08:14,410 --> 00:08:19,060 I will do yet another picks up the indentation again I'm not going to tell you to fix the indentation 110 00:08:19,060 --> 00:08:24,760 this time I'm sure you understand that probably has to be done so we took care of moderation we're on 111 00:08:24,760 --> 00:08:38,360 two posts and those and just one more I'll paste in makes that indentation and this last one is query 112 00:08:38,420 --> 00:08:39,850 and query. 113 00:08:39,850 --> 00:08:42,630 So at this point I really encourage you to do a double check. 114 00:08:42,710 --> 00:08:45,650 We should have inside this array 1 115 00:08:49,630 --> 00:08:57,700 or 5 and 6 blocks there should be all in the same indentation level double check all the image names 116 00:08:57,730 --> 00:08:59,590 in the context name as well. 117 00:08:59,590 --> 00:09:06,370 So I have going in order from top to bottom client comments event bus moderation post and query. 118 00:09:06,440 --> 00:09:10,490 All right I apologize for the long video but that is it for our scaffold email file setup. 119 00:09:11,150 --> 00:09:12,140 Let's take a pause right here. 120 00:09:12,140 --> 00:09:16,460 We're going to make use of scaffold in the next video and see how it really improves our development 121 00:09:16,460 --> 00:09:16,970 workflow.