Hopefully you've now got scaffold installed on your local system to make sure that everything is working
correctly.
You should be able to run scaffold version at the terminal and see a version print up like so if you
are running a version newer than me.
That's totally fine.
Scaffold has remained relatively unchanged over a pretty good amount of time.
And to be honest right before I record this video I was actually running version 0 2 2 and I went through
the process that we're about to go through for our application and everything still worked fine.
So it's a relatively stable API.
All right so now that we've got scaffold up and running we're going to provide some configuration to
scaffold so that it knows how to handle our project as you might guess.
This is going to take the form of creating a gamble file so here's my complex application open inside
of my code editor inside of my root project directory.
I'm going to create a very special file to configure how scaffold works.
So inside my root project I will create a file called scaffold dot Yentl.
Like so we're going to put together a small file very similar to many other that we've put together
inside this course.
This file in general is going to look a lot like a docker composed file but with a couple extra settings
here and there I'm going to tell you about all the different important settings you need to be aware
of.
But if you want to you can always go back over to the scaffold page.
Check out concepts tutorials and references if you'll look at references in particular.
There's a section on scaffold Dudamel and it's essentially a annotated Yama file that will appear and
we'll tell you about the meaning of all the different options we can set.
It looks like my browser is having a little bit of trouble actually.
Oh okay there it is finally just going a little bit slow here.
Eventually I will see a big list of all the different.
There we go finally.
So here's all the different configuration options we can provide.
But I'm going to tell you all the different options you need to be aware of.
All right.
So back inside my code.
Ed we're gonna first start off with a little bit of boilerplate so I'll say API version scaffold slash
be one data to like so notice the capital V on here as usual inside of our email file if you make any
typo inside of your stuff is not going to work as expected.
Next up we're going to specify specify a kind of config with a capital C like so and then here's where
things finally get interesting.
We're going to specify a section called built so inside of built we're going to essentially list out
all the different images or different deployments that we want scaffold to manage inside the build section.
The first option we're going to specify is something called local and then inside there we'll do a push
of false so by default scaffold whenever it builds an image is going to try to push the built image
off to say Docker Hub or whatever your default Docker repository is for local development.
It's extremely likely that you probably don't want to push these images off to some hub or repository.
You probably just want to make a change on your local machine and test it out yourself.
So you're almost always in my opinion.
You might have a very different workflow.
You're very likely going to have local push false which just means every time that scaffold builds an
image we're not going to do that push all right.
So next up we're going to define a new image or a new container that we want scaffold to manage scaffold
refers to these as artifacts so we'll define artifacts like so and this is going to be an array of different
images or essentially containers we want scaffold to manage.
So I'm gonna put in that little dash right there.
Remember in Yemen that indicates an array I'll then provide the name of the first image that I want
scaffold to manage.
So for me it's going to be Stephen Greider slash multi dash client like so after that we're going to
specify the folder where we are building this image from so for you and me it's going to be the client
directory.
So I will say context is client remember context in the world of Docker usually refers to as a refers
to a folder or something like that after that we are going to tell scaffold exactly what Docker file
we wanted to use when building our client image.
So for you and me it's going to be that Docker file dot Dev file right here.
Remember that is the docker file we use when we're trying to run a react application in a development
mode so I will say docker docker file Docker file dot Dev.
And then finally this is the really meaningful option.
Remember I just told you that scaffold operates in two separate modes.
It has mode one where any time it detects a change it's going to attempt to rebuild the entire image
from scratch and with mode to it's going to just try to take updated files and eject them into the client
pod.
So in the case of our MultiClient application we want to use mode number two because our client pod
our ReACT application is setup to automatically see changes to files and update itself so in order to
tell scaffold to use mode Number two we're gonna set another property here called sync Sync is going
to be a listing right here.
So a couple of key value pairs we're going to provide file path right here.
That can be kind of glob matters and this is going to tell what files we want scaffold to use when attempting
to use mode.
Number two.
So in our case we're gonna put in here star star slash star dot J.S. dot like so so this right here
essentially means any time scaffold sees a javascript file change just take that JavaScript file and
throw it into the container we're gonna do that same thing for CSX and h t mail files as well.
So once again this section right here is essentially what enables mode to of scaffold any time it sees
a change to a javascript file a CSX file or an H.G. mail file take that updated file and just inject
it into our running pot or container in this case.
OK.
So that's kind of part one of our scaffold general file.
Right now we are telling scaffold only to manage our MultiClient image but eventually we will also add
in some instructions on how scaffold should manage say our API server in the worker as well.
All right so I got to say this file right here we're going to take a quick pause when we come back we're
going to finish off a little bit more config inside this file.