1
00:00:01,240 --> 00:00:02,410
[Autogenerated] So next we're gonna walk

2
00:00:02,410 --> 00:00:04,330
through the process of actually utilizing

3
00:00:04,330 --> 00:00:06,990
attributes within. Get so over the course

4
00:00:06,990 --> 00:00:08,980
of this demo, here's what we're gonna do.

5
00:00:08,980 --> 00:00:10,740
First, we're gonna be adding in a get

6
00:00:10,740 --> 00:00:13,140
attributes file for a new repositories,

7
00:00:13,140 --> 00:00:15,340
and then we'll be implementing exit dips

8
00:00:15,340 --> 00:00:18,010
for image files. Then we'll be excluding

9
00:00:18,010 --> 00:00:20,940
files from release packages on Get Hub and

10
00:00:20,940 --> 00:00:22,500
then we'll be adding a clean. It's much

11
00:00:22,500 --> 00:00:24,510
filter to hide secret values within a

12
00:00:24,510 --> 00:00:27,720
repositories. So let's dive in. So first

13
00:00:27,720 --> 00:00:29,320
as a prerequisite, we're going to be

14
00:00:29,320 --> 00:00:31,260
leveraging the exit tool from the command

15
00:00:31,260 --> 00:00:33,730
line to help performed. If files on our

16
00:00:33,730 --> 00:00:35,840
images now, for this to work, you will

17
00:00:35,840 --> 00:00:38,310
need tohave the exit tool installed on

18
00:00:38,310 --> 00:00:40,570
your machine. You can look in the exercise

19
00:00:40,570 --> 00:00:42,570
files that are included within this module

20
00:00:42,570 --> 00:00:44,770
to get instructions on how to install that

21
00:00:44,770 --> 00:00:47,760
on your machine. So first we're gonna

22
00:00:47,760 --> 00:00:50,540
create a repositories that we can work in.

23
00:00:50,540 --> 00:00:52,270
Once we create a repositories, we're now

24
00:00:52,270 --> 00:00:54,140
gonna populate it with both a read me file

25
00:00:54,140 --> 00:00:56,750
and an index dot Js file. And next we need

26
00:00:56,750 --> 00:00:59,460
to add in our get attributes file. Next,

27
00:00:59,460 --> 00:01:01,120
we'll go in and edit our get attributes

28
00:01:01,120 --> 00:01:04,360
file. And so next we're going to define a

29
00:01:04,360 --> 00:01:06,230
get a tribute for J Peg files within our

30
00:01:06,230 --> 00:01:08,640
repositories, telling them to use the exit

31
00:01:08,640 --> 00:01:11,450
strategy for performing deaths will Now go

32
00:01:11,450 --> 00:01:14,700
ahead and save our file. Next, we need to

33
00:01:14,700 --> 00:01:16,440
define how we're going to leverage the

34
00:01:16,440 --> 00:01:18,570
exit tool from within our git config. And

35
00:01:18,570 --> 00:01:19,600
we're going to choose to set this

36
00:01:19,600 --> 00:01:22,510
globally. So next by using this command

37
00:01:22,510 --> 00:01:25,150
were able to now specify how get config is

38
00:01:25,150 --> 00:01:27,640
going to utilize the exit strategy and

39
00:01:27,640 --> 00:01:29,160
what tool it is gonna be leveraging, which

40
00:01:29,160 --> 00:01:31,490
in this case will be the exit tool we're

41
00:01:31,490 --> 00:01:33,080
now gonna add. These two are repositories

42
00:01:33,080 --> 00:01:35,590
and commit. I'm now gonna open the

43
00:01:35,590 --> 00:01:37,860
exercise files for this module. I'm going

44
00:01:37,860 --> 00:01:39,760
to choose to go into the original image

45
00:01:39,760 --> 00:01:43,240
folder and I'm going to copy one dot j Peg

46
00:01:43,240 --> 00:01:44,500
and then we'll move this over into our

47
00:01:44,500 --> 00:01:47,190
repositories. Now that I've moved that

48
00:01:47,190 --> 00:01:49,090
over, I'm now going to add that into the

49
00:01:49,090 --> 00:01:51,680
repositories. Now that I've committed

50
00:01:51,680 --> 00:01:53,630
that, I'm going to open up again. The

51
00:01:53,630 --> 00:01:56,190
exercise files for this module and from

52
00:01:56,190 --> 00:01:57,980
within the exercise files I'm now gonna

53
00:01:57,980 --> 00:02:00,140
navigate to modified image. I'm going to

54
00:02:00,140 --> 00:02:02,970
copy this version of one dot jpeg into our

55
00:02:02,970 --> 00:02:06,050
repositories, and we'll choose to replace

56
00:02:06,050 --> 00:02:09,070
the existing image from here. We can now

57
00:02:09,070 --> 00:02:12,130
run, get def. When we do, we'll notice

58
00:02:12,130 --> 00:02:14,000
that we're able to see the diff between

59
00:02:14,000 --> 00:02:16,050
the exit on the old version of the file

60
00:02:16,050 --> 00:02:17,940
and the new version of the file. And in

61
00:02:17,940 --> 00:02:20,940
this case, if we continue to scroll down.

62
00:02:20,940 --> 00:02:22,860
So in this case, among other things,

63
00:02:22,860 --> 00:02:24,890
you'll notice that the image, width and

64
00:02:24,890 --> 00:02:26,790
height is different between the new and

65
00:02:26,790 --> 00:02:28,760
old versions of the file. The new version

66
00:02:28,760 --> 00:02:30,560
of the file is an optimized version of the

67
00:02:30,560 --> 00:02:32,680
image that is smaller both in terms of

68
00:02:32,680 --> 00:02:35,710
size and file size. We can now clothes out

69
00:02:35,710 --> 00:02:38,670
of the diff. So next I'm gonna open up the

70
00:02:38,670 --> 00:02:41,520
exercise files for this module again. I'm

71
00:02:41,520 --> 00:02:42,970
gonna take the test directory that is

72
00:02:42,970 --> 00:02:45,320
included, and I'm going to copy it. I'm

73
00:02:45,320 --> 00:02:46,820
now going to pace that within the

74
00:02:46,820 --> 00:02:48,940
repositories. Now what we want to do with

75
00:02:48,940 --> 00:02:50,750
this is we want to configure get

76
00:02:50,750 --> 00:02:53,000
attributes so that within get hub, our

77
00:02:53,000 --> 00:02:55,960
tests directory is not included within the

78
00:02:55,960 --> 00:02:58,250
export of files. So to make this work, we

79
00:02:58,250 --> 00:03:01,110
first need to include our test directory.

80
00:03:01,110 --> 00:03:02,800
So well, now navigate back to the terminal

81
00:03:02,800 --> 00:03:04,510
and will add this to the repositories.

82
00:03:04,510 --> 00:03:07,050
Next will commit it. Now, the next step is

83
00:03:07,050 --> 00:03:09,740
that we need to add in our origin. I've

84
00:03:09,740 --> 00:03:11,990
created a depository on get hub

85
00:03:11,990 --> 00:03:13,730
specifically for this. So I'm gonna choose

86
00:03:13,730 --> 00:03:15,490
to add this in. Now that we've added in

87
00:03:15,490 --> 00:03:16,890
the remote, I'm gonna push the master

88
00:03:16,890 --> 00:03:18,780
branch to Origin. Now that we've

89
00:03:18,780 --> 00:03:20,490
successfully pushed, I'm going to add a

90
00:03:20,490 --> 00:03:22,470
tag in. At this point, I'm gonna follow

91
00:03:22,470 --> 00:03:23,900
semantic version ing standards and we'll

92
00:03:23,900 --> 00:03:26,720
call this 0.0 point one. Now we'll push

93
00:03:26,720 --> 00:03:29,920
that specific tag toe origin. Next, I'm

94
00:03:29,920 --> 00:03:31,990
gonna navigate to my repositories on get

95
00:03:31,990 --> 00:03:34,980
hub. We can see now that get Hub has been

96
00:03:34,980 --> 00:03:36,940
populated with the files that we've added

97
00:03:36,940 --> 00:03:39,160
into our repositories. I'm going to choose

98
00:03:39,160 --> 00:03:42,300
to select the releases option. From here,

99
00:03:42,300 --> 00:03:45,160
we can see our release for 0.0 point one.

100
00:03:45,160 --> 00:03:46,660
I'm gonna next used to download the zip

101
00:03:46,660 --> 00:03:50,490
file and here we can see within the export

102
00:03:50,490 --> 00:03:53,300
for our tag. 0.0 point one. All of the

103
00:03:53,300 --> 00:03:54,880
files that are in our repositories,

104
00:03:54,880 --> 00:03:57,210
including our get attributes file are

105
00:03:57,210 --> 00:04:00,430
included within the downloaded zip for the

106
00:04:00,430 --> 00:04:02,770
release. So next let's leverage get

107
00:04:02,770 --> 00:04:04,960
attributes to change that I'll navigate

108
00:04:04,960 --> 00:04:08,470
back over to the terminal. Next, we'll

109
00:04:08,470 --> 00:04:10,210
actually navigate to our get attributes

110
00:04:10,210 --> 00:04:13,740
file from within our get attributes foul

111
00:04:13,740 --> 00:04:16,400
we're going to add in two new lines. So

112
00:04:16,400 --> 00:04:18,320
the first line that we added puts an

113
00:04:18,320 --> 00:04:20,460
attribute of export ignore on anything

114
00:04:20,460 --> 00:04:21,720
that begins with a dot in the

115
00:04:21,720 --> 00:04:23,170
repositories, which would include our get

116
00:04:23,170 --> 00:04:25,380
attributes file. And next I've added in

117
00:04:25,380 --> 00:04:28,010
the same attributes on the test directory.

118
00:04:28,010 --> 00:04:30,300
So if this works properly, once we push

119
00:04:30,300 --> 00:04:32,090
this tag toe origin with the updated

120
00:04:32,090 --> 00:04:33,830
commit, we should see that the release

121
00:04:33,830 --> 00:04:35,770
would not include those files. So let's go

122
00:04:35,770 --> 00:04:38,770
ahead and save our get attributes file. So

123
00:04:38,770 --> 00:04:41,910
next we'll commit these changes. Then

124
00:04:41,910 --> 00:04:45,450
we'll add a tag, and then we'll push the

125
00:04:45,450 --> 00:04:48,200
tack. Now that that tag has been pushed,

126
00:04:48,200 --> 00:04:51,070
we will now navigate over to get Hubbell,

127
00:04:51,070 --> 00:04:52,810
and we can see now on the releases page.

128
00:04:52,810 --> 00:04:55,700
We now have a release for 0.0 point two.

129
00:04:55,700 --> 00:04:57,740
I'll click on the ZIP file and now we can

130
00:04:57,740 --> 00:04:59,400
see that the files for this specific

131
00:04:59,400 --> 00:05:01,710
release on Get Hub on Lee include the

132
00:05:01,710 --> 00:05:03,890
files that we wanted to. We have excluded

133
00:05:03,890 --> 00:05:05,770
the get attributes file along with the

134
00:05:05,770 --> 00:05:08,750
test directory, and so next will navigate

135
00:05:08,750 --> 00:05:11,490
back over to the terminal. And so next

136
00:05:11,490 --> 00:05:13,180
we're gonna be implementing are clean and

137
00:05:13,180 --> 00:05:14,720
Smudge filter, as we discussed in the

138
00:05:14,720 --> 00:05:17,180
previous clip. So our first step here will

139
00:05:17,180 --> 00:05:20,260
be to edit our index dot Js file. So from

140
00:05:20,260 --> 00:05:22,020
within this file, we want to include some

141
00:05:22,020 --> 00:05:24,640
sample code, and this sample code won't do

142
00:05:24,640 --> 00:05:26,550
anything, but it'll simply be an example

143
00:05:26,550 --> 00:05:29,240
of what we could implement with real code.

144
00:05:29,240 --> 00:05:31,200
So in this case, we have a pretend a p i

145
00:05:31,200 --> 00:05:33,390
ke. You can see it listed here, and we're

146
00:05:33,390 --> 00:05:35,060
going to say that to make some A P. I

147
00:05:35,060 --> 00:05:36,910
call. We need to pass in this AP ____. But

148
00:05:36,910 --> 00:05:39,060
here's the issue. We don't want this

149
00:05:39,060 --> 00:05:41,440
secret to end up within our repositories,

150
00:05:41,440 --> 00:05:42,920
so this becomes a good use case for

151
00:05:42,920 --> 00:05:44,940
leveraging a clean. It's much filter.

152
00:05:44,940 --> 00:05:46,620
Well, go ahead and write our index dot Js

153
00:05:46,620 --> 00:05:49,590
file. So justice. When we were creating

154
00:05:49,590 --> 00:05:51,390
the exit strategy for how we would handle

155
00:05:51,390 --> 00:05:54,340
dips for images, we defined the specifics

156
00:05:54,340 --> 00:05:56,830
of that within git, config and then we

157
00:05:56,830 --> 00:05:58,910
simply told specific files to use it

158
00:05:58,910 --> 00:06:00,680
within our get attributes file, and the

159
00:06:00,680 --> 00:06:02,580
same will be true for the clean and smudge

160
00:06:02,580 --> 00:06:04,260
filter. Now, in this case, we're going to

161
00:06:04,260 --> 00:06:07,160
use said to simply replace one value and

162
00:06:07,160 --> 00:06:09,880
put in a place holder. So our real AP I ke

163
00:06:09,880 --> 00:06:12,030
will be replaced by that place holder. So

164
00:06:12,030 --> 00:06:13,570
let's go ahead and implement the clean and

165
00:06:13,570 --> 00:06:16,290
smudge filters within the local level of

166
00:06:16,290 --> 00:06:18,950
git config. And so now that we've added

167
00:06:18,950 --> 00:06:21,340
both of those filters in both the clean

168
00:06:21,340 --> 00:06:23,140
and smudge filter, we're now ready to

169
00:06:23,140 --> 00:06:25,460
utilize get attributes to specify what

170
00:06:25,460 --> 00:06:29,160
files it needs to act on. And so now we

171
00:06:29,160 --> 00:06:31,010
specified this so that the clean it's much

172
00:06:31,010 --> 00:06:33,590
filter will work with each Java script

173
00:06:33,590 --> 00:06:35,880
file within the repositories. When we go

174
00:06:35,880 --> 00:06:37,390
through the staging process will see it

175
00:06:37,390 --> 00:06:39,700
run the clean filter, and then when we see

176
00:06:39,700 --> 00:06:41,330
it run the check out process, it'll run

177
00:06:41,330 --> 00:06:43,240
this much filter. Now that we have this in

178
00:06:43,240 --> 00:06:46,610
place, let's save our get attributes file

179
00:06:46,610 --> 00:06:49,840
Next will commit our get attributes file.

180
00:06:49,840 --> 00:06:53,010
Next, we're gonna push this to master,

181
00:06:53,010 --> 00:06:55,940
then we'll navigate over to get up. So

182
00:06:55,940 --> 00:06:57,860
from here within our repositories weaken

183
00:06:57,860 --> 00:07:00,190
now navigate to the index dot Js file. And

184
00:07:00,190 --> 00:07:01,690
when we navigate to the file, we can see

185
00:07:01,690 --> 00:07:04,170
that our actual AP ____ has been replaced

186
00:07:04,170 --> 00:07:07,090
by the placeholder for secure a p i ke.

187
00:07:07,090 --> 00:07:08,940
So, by using the clean and smudge filter,

188
00:07:08,940 --> 00:07:10,680
were able to have the real value locally

189
00:07:10,680 --> 00:07:12,990
while having a different value on the

190
00:07:12,990 --> 00:07:15,870
remote version of the repositories. So

191
00:07:15,870 --> 00:07:17,230
over the course of this demo, we've been

192
00:07:17,230 --> 00:07:19,480
able to utilize get attributes for several

193
00:07:19,480 --> 00:07:21,940
things. First of all, we have configured

194
00:07:21,940 --> 00:07:24,440
images to use the exit tool to performed

195
00:07:24,440 --> 00:07:26,600
ifs. Then, in addition to that, we were

196
00:07:26,600 --> 00:07:29,130
able to exclude specific files from the

197
00:07:29,130 --> 00:07:31,650
exported version of our depository using

198
00:07:31,650 --> 00:07:34,390
the export ignore attribute. Then we were

199
00:07:34,390 --> 00:07:36,300
able to use a clean. It's much filter to

200
00:07:36,300 --> 00:07:42,000
help protect secret values within our repositories, from ending up on a remote

