Hopefully you have now successfully installed scaffold to make sure that it is installed successfully.
Going to open up my terminal and just run the command scaffold if you run that command.
You should see a bunch of health information like this right here.
If you see something says command not recognized well you need to double check your scaffold installation
now that we've got scaffold installed.
We are going to configure it by writing out yet another config file.
This can pick violent is going to tell scaffold how to manage all the different sub projects inside
of our cluster inside of my code.
Ed I'm gonna find my root project directory and I'm gonna create a new file inside there called scaffold
thought Amel the config that we're going to write inside of here is going to look rather similar to
a lot of the configuration that we've already written to apply to a Cuban is cluster but everything
we write inside of here does not get applied to Cuba net is instead it is just consumed by scaffold
directly and scaffold is a tool that runs outside of our cluster so let's start to write out some configuration
allow the scaffold files we're gonna write are gonna be just about identical.
So this is another scenario where you pretty much just learn it once and then start to kind of copy
paste stuff around when appropriate.
All right so we're gonna write out API version scaffold B2 Alpha 3 I'm gonna put it in a kind of config
a deploy with a nested cube Seitel a nested manifests and then we're going to put in an array entry
which means a little dash and then dot slash infra AIDS star so this versatile bit of config right here
or this really is our first important piece of config is what I should say.
This is telling a scaffold that there is a collection of different config files intended for Cuban entities
inside of the infra K AIDS directory.
So by adding in this manifest line we are telling scaffold that we wanted to watch all these different
e-mail files.
Anytime that we make a change to one of those files scaffold is going to automatically reapply that
config file to our Cuban days cluster.
So in other words it's gonna save us from the hassle of having to run UCL apply dash F over and over
and over again any time that we create a file or make a change to a file by listing out manifests scaffold
is also going to make sure to create all these or apply all these anytime that we start scaffold up.
It's also going to delete all the config or all the objects associated with these config files whenever
we stop scaffold as well.
So in total this is really doing three things.
We start up scaffold apply these files when we make a change.
Apply these files whenever we stop scaffold find all the objects related to these config files and delete
them.
Don't delete the files themselves just delete the objects that are created by them inside our communities
cluster.
This is really the part where this is fantastic for working between different projects because whenever
we start up scaffold we're going to apply all these objects.
Whenever we stop scaffold to go work on another project all the objects related to these will be deleted
and we'll end up with a relatively clean cluster.
So that's part one of our config file.
Now onto step 2 We're gonna put in a build local push of false so I default whenever scaffold makes
a change to one of our images or rebuild an image that's going to try to push it up to Docker Hub.
That is not actually required when we're using scaffold so we're going to disable that default behavior
with the setting right here.
Next up is artifacts and I've got a typo in their artifacts.
Make sure you got the right spelling.
This is going to be an array.
We're going to write out one array entry and we'll discuss what it is doing.
I'm gonna put an image of my doc right.
So for you it should be your doc right.
Flash client well then put in a context of client I'll put in Docker with nested Docker file and the
value of that is going to be a docker file with a capital D then put it in sync manual in a rate entry
a source that is gonna be a string of S or C star star flash star dot J.S. with a DST or destination
of period OK.
So what is this all about this artifact section is telling scaffold about something inside of a project
that it needs to maintain essentially saying that there is going to be some pod that is running code
out of the client directory inside of our project so in this case client directory right here.
Whenever something changes inside this directory scaffold is going to try to take those changes and
somehow.
Update our pod.
There are two ways in which scaffold is going to try to update our pod.
First off if we make a change to a javascript file as indicated by this little match right here.
If we make a change to a javascript file then scaffold is going to try to take that change file and
just directly throw it into our pod.
That's going to literally take that file we updated and copy it directly into the pot itself.
So our pod is going to always have the latest code inside of it.
If we ever make a change to anything inside this client directory that is not matched up by this S.R.
C or this entire little rural right here then scaffold is going to instead try to rebuild the entire
image.
So for example imagine if we installed a new dependency into our client project whenever we install
a new dependency that's going to update our package not just on file.
Technically package lock and technically node modules as well but basically it is making a change to
our project that is not changing a javascript file.
So because we made a change to a file that is not matching up to little match right here.
Scaffold is going to decide to completely rebuild our image and update the deployment tied to it though
it's going to rebuild this image.
It's going to use this client directory as the source of the image.
Once the image is built it's going to throw it as the update into our cluster those are the two things
that this big roll right here is really doing.
Either update these files in place or if it's a different file rebuild the entire image so we're now
going to go through and essentially duplicate this rule for all of our other little set projects inside
of here.
So for comments event US moderation posts and query I'm going to copy this rule rather than just rewrite
all of it.
Now when you copy this stuff you might have a little bit of automatic formatting kick in.
I definitely did.
Let's see.
So if you get that automatic formatting and you tried to fix the indentation just make sure you don't
mess up any of the previous stuff as I just did right there.
You should have something like this.
We should see it Dash image and then dash the image down there.
Make sure you got the right indentation as well.
So now we will update this block for the comments.
So this image is called your doctor I.D. such comments.
The context is comments.
Same Docker file but in this case our files thinking is gonna be a little bit different.
Remember only the react application had an S RC directory everything else so say comments moderation
et cetera.
No s RC directory we only have a direct index dot J S file inside there so we will update that little
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
to once again copy this thing.
I'll make sure I fix up the indentation
Aereo though again makes you got the correct indentation and on this next one will update for event
dash bus so update 1 update 2 OK next one I'll do another paste in a fix my indentation again
there's event bus right above here's the copy paste I just put in this one I will make for this one
I'm going to make or moderation
I will do yet another picks up the indentation again I'm not going to tell you to fix the indentation
this time I'm sure you understand that probably has to be done so we took care of moderation we're on
two posts and those and just one more I'll paste in makes that indentation and this last one is query
and query.
So at this point I really encourage you to do a double check.
We should have inside this array 1
or 5 and 6 blocks there should be all in the same indentation level double check all the image names
in the context name as well.
So I have going in order from top to bottom client comments event bus moderation post and query.
All right I apologize for the long video but that is it for our scaffold email file setup.
Let's take a pause right here.
We're going to make use of scaffold in the next video and see how it really improves our development
workflow.