1 00:00:01,090 --> 00:00:04,140 In this video we're going to set up our scaffold config file. 2 00:00:04,200 --> 00:00:07,520 The scaffold config file is going to watch our infra directory. 3 00:00:07,570 --> 00:00:11,590 Any time we make a change to a config file it will automatically apply it to our cluster. 4 00:00:11,620 --> 00:00:16,060 It's also going to make sure that Einstein would change any code inside of our art directory. 5 00:00:16,090 --> 00:00:21,070 It will sink all the files inside there with the appropriate running container inside of our cluster 6 00:00:22,180 --> 00:00:24,230 so to create our scaffolds config file. 7 00:00:24,260 --> 00:00:29,240 I'm going to find my root project directory and inside there I'll make another file called scaffold 8 00:00:29,390 --> 00:00:30,470 dot demo. 9 00:00:30,500 --> 00:00:36,920 Like so inside of here we're gonna write out some config it's going to be absolutely identical in nature 10 00:00:36,950 --> 00:00:37,900 to the project. 11 00:00:37,910 --> 00:00:42,800 We are just working on this one or two very small things are going to change the inside if you're all 12 00:00:42,830 --> 00:00:54,370 put in an API version of scaffold slash to Alpha 3 a kind of config I'll setup a deployed section deploy 13 00:00:54,390 --> 00:00:59,940 section is going to list out all the different config files we want to load into our cluster inside 14 00:00:59,940 --> 00:01:07,350 of deploy We'll list out cubes TTL manifests and then we'll list out all the directories are all the 15 00:01:07,350 --> 00:01:09,720 files we want to sync or make use of. 16 00:01:09,900 --> 00:01:16,910 So in our case we're going to say take a look at infra hates star so get all the files inside of infra 17 00:01:16,930 --> 00:01:22,350 k it star and really at the start of that path we should put in a dot slash like so to say from the 18 00:01:22,350 --> 00:01:30,460 current working directory go into infra then case and then find all the files inside their next up at 19 00:01:30,460 --> 00:01:37,020 the very top level of indentation we'll set up a build they're going to put in local with a push of 20 00:01:37,020 --> 00:01:37,800 false. 21 00:01:37,890 --> 00:01:42,450 Once again this is going to say that whenever we build an image do not try to push it off to Docker 22 00:01:42,450 --> 00:01:49,600 Hub or anything like that which is the default behavior well then list out our artifacts. 23 00:01:49,630 --> 00:01:54,310 So these are going to be all the things that are going to be built and I need to fix my spelling that 24 00:01:54,310 --> 00:02:01,400 is better they're going to list out the image that's going to be produced by that art project. 25 00:02:01,400 --> 00:02:08,960 So inside of you I'll say there's going to be an image called my doc right slash off the context or 26 00:02:08,960 --> 00:02:17,010 the folder that contains all the code for this image is off the list out of context of off going to 27 00:02:17,020 --> 00:02:18,880 specify the docker file to use. 28 00:02:18,930 --> 00:02:22,020 They'll say docker docker file Docker file. 29 00:02:22,050 --> 00:02:29,550 Notice the capitalization here so lowercase d lowercase and capital D and we'll set up the sink section 30 00:02:30,270 --> 00:02:36,780 which is going to tell scaffold how to handle any files that change inside of your we'll say that we're 31 00:02:36,780 --> 00:02:40,770 gonna give it some manual configuration and be very explicit about what to do when some files inside 32 00:02:40,770 --> 00:02:45,190 of your change are going to say array entry. 33 00:02:45,190 --> 00:02:48,200 So those the dash right there source. 34 00:02:48,240 --> 00:02:52,160 So this is going to be the set of files that scaffold needs to watch. 35 00:02:52,290 --> 00:02:57,900 I want scaffold to watch inside of my S.R. see directory and find all the files inside there at that 36 00:02:57,900 --> 00:03:04,230 end with dot t yes because we want to sync all the relevant typescript files so inside of a set of single 37 00:03:04,230 --> 00:03:09,870 quotes I will list out as RC flash star star slash dot t s 38 00:03:13,350 --> 00:03:20,750 and we'll set up a destination of dots the destination of dot means where to sync this file to inside 39 00:03:20,750 --> 00:03:25,460 of our running container the dot means basically just take wherever the file was found from and throw 40 00:03:25,460 --> 00:03:30,440 it to the corresponding path inside the container. 41 00:03:30,460 --> 00:03:33,130 All right so that should be enough config to get us started. 42 00:03:33,230 --> 00:03:37,900 So I going to say this file and we're going to go back over to our terminal and run scaffold and just 43 00:03:37,900 --> 00:03:42,100 make sure that we can get our project up and running inside of our cluster. 44 00:03:42,270 --> 00:03:43,570 It's going to go back over to my terminal 45 00:03:46,390 --> 00:03:51,230 if you are still running scaffold from the previous project do make sure that you close it at this point. 46 00:03:51,340 --> 00:03:55,270 So you'll want to find the terminal window that is running scaffold and press control see inside of 47 00:03:55,270 --> 00:03:56,410 it. 48 00:03:56,410 --> 00:04:02,210 Well then change into our ticketing directory which is where our scaffold dot emo file should be. 49 00:04:02,470 --> 00:04:09,300 And inside of here we should be able to do a scaffold Dev like so if you get an error the first time 50 00:04:09,300 --> 00:04:10,560 you run scaffold Dev. 51 00:04:10,560 --> 00:04:11,440 That's totally fine. 52 00:04:11,460 --> 00:04:16,880 Try killing the process with control C and then running scaffold dead Dev a second time. 53 00:04:16,980 --> 00:04:20,340 You only have to do that if you end up seeing some kind of distinct error message. 54 00:04:20,340 --> 00:04:28,020 Just you know warnings as you see right here are not errors they are simply warnings not errors. 55 00:04:28,200 --> 00:04:31,120 OK so it looks like I successfully built the image. 56 00:04:31,370 --> 00:04:37,310 We then started to deploy with scaffold a off deployment was created and an off service was created 57 00:04:37,340 --> 00:04:38,350 as well. 58 00:04:38,450 --> 00:04:42,460 And then right here I can see all the output coming from my newly running container. 59 00:04:43,340 --> 00:04:46,850 So I've got my listening on port three thousand right there. 60 00:04:46,850 --> 00:04:48,160 Awesome. 61 00:04:48,240 --> 00:04:53,190 Now at this point in time in theory we should be able to go back over to our art project open up the 62 00:04:53,190 --> 00:04:53,950 index dodge it. 63 00:04:53,970 --> 00:04:55,670 T.S. file inside there. 64 00:04:55,680 --> 00:05:00,100 Make changes to this thing and see it reflected inside of scaffold. 65 00:05:00,180 --> 00:05:03,990 So I'm going to find the console log where we say listening port three thousand and I'm gonna add in 66 00:05:04,110 --> 00:05:09,160 a couple of exclamations at the end like so I'll then save the file. 67 00:05:09,180 --> 00:05:14,840 I'm going to flip back over and I should see it listening on port three thousand with a bunch more exclamations 68 00:05:14,870 --> 00:05:20,140 like so now if you do not see that update right away that is totally okay. 69 00:05:20,190 --> 00:05:25,980 Remember I mentioned that sometimes we run into some really big issues on detecting changes made to 70 00:05:25,980 --> 00:05:28,260 projects that are running inside of a docker container. 71 00:05:28,470 --> 00:05:31,150 So if you don't see an immediate change that is fine. 72 00:05:31,260 --> 00:05:35,250 Let's take a quick pause right here and take a look at what you should do if you do not see a change.