In this video we're going to set up our scaffold config file.
The scaffold config file is going to watch our infra directory.
Any time we make a change to a config file it will automatically apply it to our cluster.
It's also going to make sure that Einstein would change any code inside of our art directory.
It will sink all the files inside there with the appropriate running container inside of our cluster
so to create our scaffolds config file.
I'm going to find my root project directory and inside there I'll make another file called scaffold
dot demo.
Like so inside of here we're gonna write out some config it's going to be absolutely identical in nature
to the project.
We are just working on this one or two very small things are going to change the inside if you're all
put in an API version of scaffold slash to Alpha 3 a kind of config I'll setup a deployed section deploy
section is going to list out all the different config files we want to load into our cluster inside
of deploy We'll list out cubes TTL manifests and then we'll list out all the directories are all the
files we want to sync or make use of.
So in our case we're going to say take a look at infra hates star so get all the files inside of infra
k it star and really at the start of that path we should put in a dot slash like so to say from the
current working directory go into infra then case and then find all the files inside their next up at
the very top level of indentation we'll set up a build they're going to put in local with a push of
false.
Once again this is going to say that whenever we build an image do not try to push it off to Docker
Hub or anything like that which is the default behavior well then list out our artifacts.
So these are going to be all the things that are going to be built and I need to fix my spelling that
is better they're going to list out the image that's going to be produced by that art project.
So inside of you I'll say there's going to be an image called my doc right slash off the context or
the folder that contains all the code for this image is off the list out of context of off going to
specify the docker file to use.
They'll say docker docker file Docker file.
Notice the capitalization here so lowercase d lowercase and capital D and we'll set up the sink section
which is going to tell scaffold how to handle any files that change inside of your we'll say that we're
gonna give it some manual configuration and be very explicit about what to do when some files inside
of your change are going to say array entry.
So those the dash right there source.
So this is going to be the set of files that scaffold needs to watch.
I want scaffold to watch inside of my S.R. see directory and find all the files inside there at that
end with dot t yes because we want to sync all the relevant typescript files so inside of a set of single
quotes I will list out as RC flash star star slash dot t s
and we'll set up a destination of dots the destination of dot means where to sync this file to inside
of our running container the dot means basically just take wherever the file was found from and throw
it to the corresponding path inside the container.
All right so that should be enough config to get us started.
So I going to say this file and we're going to go back over to our terminal and run scaffold and just
make sure that we can get our project up and running inside of our cluster.
It's going to go back over to my terminal
if you are still running scaffold from the previous project do make sure that you close it at this point.
So you'll want to find the terminal window that is running scaffold and press control see inside of
it.
Well then change into our ticketing directory which is where our scaffold dot emo file should be.
And inside of here we should be able to do a scaffold Dev like so if you get an error the first time
you run scaffold Dev.
That's totally fine.
Try killing the process with control C and then running scaffold dead Dev a second time.
You only have to do that if you end up seeing some kind of distinct error message.
Just you know warnings as you see right here are not errors they are simply warnings not errors.
OK so it looks like I successfully built the image.
We then started to deploy with scaffold a off deployment was created and an off service was created
as well.
And then right here I can see all the output coming from my newly running container.
So I've got my listening on port three thousand right there.
Awesome.
Now at this point in time in theory we should be able to go back over to our art project open up the
index dodge it.
T.S. file inside there.
Make changes to this thing and see it reflected inside of scaffold.
So I'm going to find the console log where we say listening port three thousand and I'm gonna add in
a couple of exclamations at the end like so I'll then save the file.
I'm going to flip back over and I should see it listening on port three thousand with a bunch more exclamations
like so now if you do not see that update right away that is totally okay.
Remember I mentioned that sometimes we run into some really big issues on detecting changes made to
projects that are running inside of a docker container.
So if you don't see an immediate change that is fine.
Let's take a quick pause right here and take a look at what you should do if you do not see a change.