1
00:00:00,670 --> 00:00:04,930
Hopefully you've now got scaffold installed on your local system to make sure that everything is working

2
00:00:04,930 --> 00:00:05,580
correctly.

3
00:00:05,590 --> 00:00:11,770
You should be able to run scaffold version at the terminal and see a version print up like so if you

4
00:00:11,770 --> 00:00:13,170
are running a version newer than me.

5
00:00:13,180 --> 00:00:14,590
That's totally fine.

6
00:00:14,590 --> 00:00:18,840
Scaffold has remained relatively unchanged over a pretty good amount of time.

7
00:00:19,120 --> 00:00:24,790
And to be honest right before I record this video I was actually running version 0 2 2 and I went through

8
00:00:24,790 --> 00:00:28,980
the process that we're about to go through for our application and everything still worked fine.

9
00:00:29,080 --> 00:00:30,810
So it's a relatively stable API.

10
00:00:31,600 --> 00:00:35,760
All right so now that we've got scaffold up and running we're going to provide some configuration to

11
00:00:35,760 --> 00:00:39,840
scaffold so that it knows how to handle our project as you might guess.

12
00:00:39,840 --> 00:00:46,220
This is going to take the form of creating a gamble file so here's my complex application open inside

13
00:00:46,220 --> 00:00:49,740
of my code editor inside of my root project directory.

14
00:00:49,810 --> 00:00:54,210
I'm going to create a very special file to configure how scaffold works.

15
00:00:54,390 --> 00:00:59,000
So inside my root project I will create a file called scaffold dot Yentl.

16
00:00:59,080 --> 00:01:05,660
Like so we're going to put together a small file very similar to many other that we've put together

17
00:01:05,780 --> 00:01:07,130
inside this course.

18
00:01:07,130 --> 00:01:11,990
This file in general is going to look a lot like a docker composed file but with a couple extra settings

19
00:01:11,990 --> 00:01:16,570
here and there I'm going to tell you about all the different important settings you need to be aware

20
00:01:16,570 --> 00:01:16,910
of.

21
00:01:16,960 --> 00:01:20,130
But if you want to you can always go back over to the scaffold page.

22
00:01:20,260 --> 00:01:25,380
Check out concepts tutorials and references if you'll look at references in particular.

23
00:01:25,460 --> 00:01:31,330
There's a section on scaffold Dudamel and it's essentially a annotated Yama file that will appear and

24
00:01:31,330 --> 00:01:34,910
we'll tell you about the meaning of all the different options we can set.

25
00:01:34,910 --> 00:01:37,810
It looks like my browser is having a little bit of trouble actually.

26
00:01:37,830 --> 00:01:40,810
Oh okay there it is finally just going a little bit slow here.

27
00:01:41,870 --> 00:01:44,180
Eventually I will see a big list of all the different.

28
00:01:44,210 --> 00:01:45,020
There we go finally.

29
00:01:45,050 --> 00:01:47,820
So here's all the different configuration options we can provide.

30
00:01:47,900 --> 00:01:50,660
But I'm going to tell you all the different options you need to be aware of.

31
00:01:51,840 --> 00:01:52,200
All right.

32
00:01:52,200 --> 00:01:53,160
So back inside my code.

33
00:01:53,170 --> 00:02:01,110
Ed we're gonna first start off with a little bit of boilerplate so I'll say API version scaffold slash

34
00:02:01,180 --> 00:02:08,360
be one data to like so notice the capital V on here as usual inside of our email file if you make any

35
00:02:08,360 --> 00:02:12,750
typo inside of your stuff is not going to work as expected.

36
00:02:12,760 --> 00:02:20,610
Next up we're going to specify specify a kind of config with a capital C like so and then here's where

37
00:02:20,610 --> 00:02:21,930
things finally get interesting.

38
00:02:21,930 --> 00:02:26,880
We're going to specify a section called built so inside of built we're going to essentially list out

39
00:02:27,000 --> 00:02:34,820
all the different images or different deployments that we want scaffold to manage inside the build section.

40
00:02:34,820 --> 00:02:39,770
The first option we're going to specify is something called local and then inside there we'll do a push

41
00:02:39,830 --> 00:02:47,020
of false so by default scaffold whenever it builds an image is going to try to push the built image

42
00:02:47,110 --> 00:02:53,770
off to say Docker Hub or whatever your default Docker repository is for local development.

43
00:02:53,800 --> 00:03:00,320
It's extremely likely that you probably don't want to push these images off to some hub or repository.

44
00:03:00,370 --> 00:03:04,000
You probably just want to make a change on your local machine and test it out yourself.

45
00:03:04,970 --> 00:03:06,820
So you're almost always in my opinion.

46
00:03:06,830 --> 00:03:08,510
You might have a very different workflow.

47
00:03:08,510 --> 00:03:13,520
You're very likely going to have local push false which just means every time that scaffold builds an

48
00:03:13,520 --> 00:03:17,400
image we're not going to do that push all right.

49
00:03:17,400 --> 00:03:26,350
So next up we're going to define a new image or a new container that we want scaffold to manage scaffold

50
00:03:26,350 --> 00:03:32,770
refers to these as artifacts so we'll define artifacts like so and this is going to be an array of different

51
00:03:32,830 --> 00:03:36,220
images or essentially containers we want scaffold to manage.

52
00:03:36,270 --> 00:03:37,900
So I'm gonna put in that little dash right there.

53
00:03:37,900 --> 00:03:44,280
Remember in Yemen that indicates an array I'll then provide the name of the first image that I want

54
00:03:44,280 --> 00:03:46,000
scaffold to manage.

55
00:03:46,110 --> 00:03:54,150
So for me it's going to be Stephen Greider slash multi dash client like so after that we're going to

56
00:03:54,150 --> 00:04:00,320
specify the folder where we are building this image from so for you and me it's going to be the client

57
00:04:00,320 --> 00:04:01,190
directory.

58
00:04:01,280 --> 00:04:09,050
So I will say context is client remember context in the world of Docker usually refers to as a refers

59
00:04:09,050 --> 00:04:16,190
to a folder or something like that after that we are going to tell scaffold exactly what Docker file

60
00:04:16,250 --> 00:04:19,430
we wanted to use when building our client image.

61
00:04:19,430 --> 00:04:23,450
So for you and me it's going to be that Docker file dot Dev file right here.

62
00:04:23,450 --> 00:04:28,670
Remember that is the docker file we use when we're trying to run a react application in a development

63
00:04:28,670 --> 00:04:42,100
mode so I will say docker docker file Docker file dot Dev.

64
00:04:42,260 --> 00:04:45,260
And then finally this is the really meaningful option.

65
00:04:45,260 --> 00:04:49,380
Remember I just told you that scaffold operates in two separate modes.

66
00:04:49,400 --> 00:04:54,410
It has mode one where any time it detects a change it's going to attempt to rebuild the entire image

67
00:04:54,410 --> 00:05:00,350
from scratch and with mode to it's going to just try to take updated files and eject them into the client

68
00:05:00,350 --> 00:05:01,460
pod.

69
00:05:01,520 --> 00:05:06,860
So in the case of our MultiClient application we want to use mode number two because our client pod

70
00:05:06,890 --> 00:05:13,920
our ReACT application is setup to automatically see changes to files and update itself so in order to

71
00:05:13,920 --> 00:05:21,530
tell scaffold to use mode Number two we're gonna set another property here called sync Sync is going

72
00:05:21,530 --> 00:05:23,540
to be a listing right here.

73
00:05:23,540 --> 00:05:28,280
So a couple of key value pairs we're going to provide file path right here.

74
00:05:28,310 --> 00:05:34,400
That can be kind of glob matters and this is going to tell what files we want scaffold to use when attempting

75
00:05:34,400 --> 00:05:35,180
to use mode.

76
00:05:35,180 --> 00:05:36,570
Number two.

77
00:05:36,590 --> 00:05:45,550
So in our case we're gonna put in here star star slash star dot J.S. dot like so so this right here

78
00:05:45,550 --> 00:05:52,630
essentially means any time scaffold sees a javascript file change just take that JavaScript file and

79
00:05:52,630 --> 00:06:01,930
throw it into the container we're gonna do that same thing for CSX and h t mail files as well.

80
00:06:01,960 --> 00:06:07,360
So once again this section right here is essentially what enables mode to of scaffold any time it sees

81
00:06:07,360 --> 00:06:13,870
a change to a javascript file a CSX file or an H.G. mail file take that updated file and just inject

82
00:06:13,870 --> 00:06:19,940
it into our running pot or container in this case.

83
00:06:20,150 --> 00:06:20,420
OK.

84
00:06:20,450 --> 00:06:23,970
So that's kind of part one of our scaffold general file.

85
00:06:24,050 --> 00:06:29,540
Right now we are telling scaffold only to manage our MultiClient image but eventually we will also add

86
00:06:29,540 --> 00:06:35,930
in some instructions on how scaffold should manage say our API server in the worker as well.

87
00:06:35,930 --> 00:06:39,560
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

88
00:06:39,560 --> 00:06:42,140
going to finish off a little bit more config inside this file.
