1
00:00:00,660 --> 00:00:05,090
In the last section we created our service account and we downloaded a case on file that contains some

2
00:00:05,090 --> 00:00:07,260
credentials for that service account.

3
00:00:07,310 --> 00:00:11,900
We now need to download and install the Travis Seelye which is a program that we're going to use to

4
00:00:11,930 --> 00:00:16,830
encrypt that service account based on file and tie it to our Travis C.I. account.

5
00:00:16,910 --> 00:00:20,710
Remember the entire idea behind this is that the Jason File we just download it.

6
00:00:20,730 --> 00:00:24,330
So this one right here has some very sensitive information inside of it.

7
00:00:24,380 --> 00:00:28,550
And we do not want to expose it to the outside world from our get hub account.

8
00:00:28,550 --> 00:00:28,880
All right.

9
00:00:28,880 --> 00:00:34,360
So to download and install the Travis Seelye we can go to get hakama.

10
00:00:34,370 --> 00:00:35,160
Blah blah blah.

11
00:00:35,240 --> 00:00:37,610
And download this thing and install it.

12
00:00:37,620 --> 00:00:43,750
However there's just one little awkward thing about the Travis CLID and that is that requires Rubie

13
00:00:43,760 --> 00:00:45,790
to be installed on your local system.

14
00:00:45,800 --> 00:00:52,210
Now if you're on a Mac OS machine you're in luck because by default Ruby is installed on Mac OS.

15
00:00:52,220 --> 00:00:56,970
However if you are on Windows well life is a little bit harder on Windows.

16
00:00:56,990 --> 00:01:03,760
Installing Ruby is a little bit more challenging and it's kind of a pain in the rear.

17
00:01:03,850 --> 00:01:07,840
Now I would hate to have to go through the installation process with you if you're on Windows because

18
00:01:07,840 --> 00:01:12,940
it is a little bit of a pain and it takes a decent amount of time but there is a little work around

19
00:01:13,000 --> 00:01:14,110
that we can use.

20
00:01:14,140 --> 00:01:17,440
I want you to remember what we've been doing in this entire course.

21
00:01:17,530 --> 00:01:22,930
We've been creating darker images and containers and the entire purpose of these containers is that

22
00:01:22,930 --> 00:01:28,660
we can very easily get some different environment up and running on our local machine with some very

23
00:01:28,660 --> 00:01:32,290
customized dependencies inside that container.

24
00:01:32,290 --> 00:01:37,720
So I think that rather than trying to install Ruby locally on your machine especially if you are on

25
00:01:37,720 --> 00:01:44,630
Windows instead let's try getting a docker image that has Ruby pre-installed inside of it.

26
00:01:45,540 --> 00:01:48,420
So we're going to get an image that has Ruby pre-installed.

27
00:01:48,570 --> 00:01:54,150
Well then open up a shell or a terminal inside that container and then we'll use that to install and

28
00:01:54,150 --> 00:01:55,870
run that Travis Seelye.

29
00:01:55,930 --> 00:01:59,940
There's only a single command we have to run with Travis Seelye Selye essentially you know just the

30
00:01:59,940 --> 00:02:02,820
one command to encrypt that file that we care about.

31
00:02:02,910 --> 00:02:07,230
So we don't really need a persistent version of the Travis Selye to sit around because we just want

32
00:02:07,230 --> 00:02:09,500
to use at one time and then throw it away.

33
00:02:09,600 --> 00:02:13,800
So this would actually be a great use case where we could use a dock or container with Ruby already

34
00:02:13,800 --> 00:02:19,620
installed inside of it to install install Travis Seelye use it to encrypt the file and then throw the

35
00:02:19,620 --> 00:02:22,780
entire container away because we don't need it for anything else.

36
00:02:23,190 --> 00:02:24,560
So let's give this a shot.

37
00:02:25,730 --> 00:02:30,200
Now in the section as we go through this process we are going to be running a good number of commands

38
00:02:30,480 --> 00:02:34,550
and so I wanted to put all the commands up here in all the different steps are going to go through just

39
00:02:34,580 --> 00:02:37,220
in case you are skipping does video rather quickly.

40
00:02:37,220 --> 00:02:40,610
I want to make sure that you don't accidentally skip one of the commands inside of here.

41
00:02:40,760 --> 00:02:45,320
So I would almost recommend that you take a screenshot of this diagram right here just to make sure

42
00:02:45,320 --> 00:02:48,450
that you nail each and every one of these commands.

43
00:02:48,620 --> 00:02:53,900
So the first thing that we're going to do is execute a docker run command the image that we're going

44
00:02:53,900 --> 00:03:00,510
to be running is Ruby version 2.3 and then at the same time we're going to start up a shell inside there.

45
00:03:00,710 --> 00:03:03,020
And we're also going to set up a volume.

46
00:03:03,020 --> 00:03:09,020
The purpose of the volume right here is to eventually get the service account on file inside the container.

47
00:03:09,020 --> 00:03:10,910
Remember this is the file that we want to encrypt.

48
00:03:10,940 --> 00:03:13,780
So we need to make sure that it is available inside the container.

49
00:03:14,180 --> 00:03:16,400
So we're going to use a volume to do that.

50
00:03:16,460 --> 00:03:20,490
Now notice that we're using the dollar sign parentheses interpellation here.

51
00:03:20,510 --> 00:03:26,690
This is only valid if you're on a UNIX based system or if you're on Windows using get bash as your terminal.

52
00:03:26,690 --> 00:03:31,970
If you are on Windows and you're using something like the command line or Cowper's shell you're going

53
00:03:31,970 --> 00:03:33,920
to use curly braces instead.

54
00:03:33,920 --> 00:03:35,950
So just be aware that little difference.

55
00:03:36,490 --> 00:03:38,200
OK so let's get to it.

56
00:03:38,210 --> 00:03:42,320
I'm going to open up my terminal and I'm going to make sure that I'm inside of my complex directory

57
00:03:42,410 --> 00:03:49,010
because we're going to eventually put that JS on file inside of here and encrypt it and we're using

58
00:03:49,010 --> 00:03:53,750
specifically the complex directory because remember we're going to make sure that the volume is available

59
00:03:54,020 --> 00:03:55,420
inside the container.

60
00:03:55,460 --> 00:04:05,780
So do Daka run dash dash V to set up the volume or say sign PWT to say present working directory of

61
00:04:05,870 --> 00:04:12,710
the complex folder or then do a colon and I'm going to map this present working directory of complex

62
00:04:12,920 --> 00:04:16,670
to the folder about app inside the container.

63
00:04:16,670 --> 00:04:19,340
Now we don't actually have any app thing to put inside the container.

64
00:04:19,340 --> 00:04:22,940
I'm just choosing that folder name toll at totally at random.

65
00:04:22,950 --> 00:04:26,120
You could probably figure out a better name but honestly it just doesn't really matter that much.

66
00:04:27,050 --> 00:04:34,260
Well then specify the image of Ruby 2.3 and then the command that I want to run inside of this container

67
00:04:34,320 --> 00:04:39,490
is S.H. to start a shell inside their sung and run this command.

68
00:04:40,480 --> 00:04:45,610
Now when I run the command I immediately get kicked into a terminal right here or a shell inside the

69
00:04:45,610 --> 00:04:46,310
container.

70
00:04:46,390 --> 00:04:50,110
Because I've already downloaded the ruby image in the past for you.

71
00:04:50,140 --> 00:04:54,610
You probably need to download this image and so it's going to take maybe a minute or two to download

72
00:04:54,610 --> 00:04:56,880
the image and then eventually create a container out of it.

73
00:04:57,040 --> 00:05:01,570
So I encourage you to pause if you're right now and just leave it paused until you eventually get into

74
00:05:01,570 --> 00:05:05,220
a shell like so OK.

75
00:05:05,240 --> 00:05:10,750
So if you're now here I'm going to assume that you've successfully gotten into a shell inside the container.

76
00:05:11,000 --> 00:05:14,270
So if we now do an ls we can see that app folder.

77
00:05:14,300 --> 00:05:15,590
So there's the app folder right there.

78
00:05:15,590 --> 00:05:18,650
The one that we just set up as a volume.

79
00:05:18,700 --> 00:05:22,990
If I change into that app folder and I encourage you to do so right now as well so I can to make sure

80
00:05:22,990 --> 00:05:24,510
I'm inside that folder.

81
00:05:24,670 --> 00:05:32,300
I can do an ls and I'll see all of the project folders out of our original complex directory so definitely

82
00:05:32,300 --> 00:05:33,770
worked out pretty well so far.

83
00:05:34,090 --> 00:05:37,570
So now the next thing we're going to do is install Travis.

84
00:05:37,610 --> 00:05:39,930
This is the Travis Selye.

85
00:05:40,100 --> 00:05:41,960
We're installing it by using the program.

86
00:05:41,990 --> 00:05:46,760
Jim Jim is essentially a dependency manager for the Ruby programming language.

87
00:05:46,760 --> 00:05:55,610
So we're using the gym program to install Travis they'll do Jim install Travis and I'll put on no dash.

88
00:05:55,750 --> 00:05:58,520
Dock and no Arye.

89
00:05:58,880 --> 00:06:02,500
And these two flags over here at the right hand side these are 100 percent optional.

90
00:06:02,510 --> 00:06:06,900
They're essentially saying Do not attempt to install any documentation along with this Jim.

91
00:06:06,920 --> 00:06:10,020
It just makes the installation go very very slightly faster.

92
00:06:10,790 --> 00:06:16,490
All right so I got to run this and then we're going to very quickly see everything get installed.

93
00:06:17,330 --> 00:06:17,720
All right.

94
00:06:17,720 --> 00:06:19,310
Now looks like I paused there for a second.

95
00:06:19,310 --> 00:06:23,320
On building native extensions now something kind of interesting.

96
00:06:23,320 --> 00:06:28,610
I want to mention this is a total side topic completely unrelated from all this Travis stuff and you're

97
00:06:28,610 --> 00:06:32,200
probably going to hate me for going on a side topic while we're running all these intense commands.

98
00:06:32,210 --> 00:06:34,180
But I I half do it.

99
00:06:34,190 --> 00:06:36,040
I have to tell you about this side topic.

100
00:06:36,080 --> 00:06:38,230
I feel 100 percent compelled to do so.

101
00:06:38,240 --> 00:06:42,500
So you notice during that entire process it says building native extensions right here.

102
00:06:42,500 --> 00:06:48,050
That's essentially a step we're Ruby and the gym program are taking a bunch of ruby source code files

103
00:06:48,170 --> 00:06:51,890
and essentially compiling them to get them to work on your local system.

104
00:06:51,890 --> 00:06:57,590
Now that's kind of a build step and it requires some modules inside of Ruby to be installed or essentially

105
00:06:57,590 --> 00:07:01,320
is kind of it development programs to be installed with Ruby.

106
00:07:01,340 --> 00:07:06,800
One thing you might notice that's kind of interesting is when we originally ran that Daka run command

107
00:07:06,800 --> 00:07:12,200
right here we specified a image tagged as 2.3 from Ruby.

108
00:07:12,200 --> 00:07:21,170
If you actually open up the docker hub page it's a ducker hub for that Ruby image we just made use of

109
00:07:21,180 --> 00:07:24,260
song in a search for Ruby and then go to the repository right here.

110
00:07:24,260 --> 00:07:30,250
You'll notice that there are a ton of other versions available some of which are tagged as Alpine.

111
00:07:30,260 --> 00:07:35,300
So remember a Alpine version of an image is essentially just saying hey this is a stripped down version

112
00:07:35,300 --> 00:07:40,180
of the image with just the bare minimum required to get this thing running.

113
00:07:40,340 --> 00:07:46,550
Now in our case we had to install a gym that did this extra build step in like I said that requires

114
00:07:46,550 --> 00:07:53,050
some extra packages to be installed with Ruby if we had to use the Alpine version of this Ruby image.

115
00:07:53,060 --> 00:07:57,890
This step right here would have actually completely failed because remember the Alpine version is 100

116
00:07:57,890 --> 00:08:03,740
percent stripped down and so the Alpine version of the Ruby image does not have those extra practice

117
00:08:03,740 --> 00:08:07,700
required to do this step of building a native extension.

118
00:08:07,880 --> 00:08:09,460
So if we had used.

119
00:08:09,650 --> 00:08:12,630
I keep scrolling up because I think the command is up there but it's not.

120
00:08:12,680 --> 00:08:19,220
If we had used an Alpine version like say Alpine 2.3 right here that Jim install step would have failed

121
00:08:19,250 --> 00:08:23,900
because we did not have all the dependencies required to build this Jim.

122
00:08:23,920 --> 00:08:28,780
So this is a great example where the Alpine version of an image is not always the best solution.

123
00:08:28,940 --> 00:08:30,360
Not always the best solution.

124
00:08:30,740 --> 00:08:30,990
OK.

125
00:08:31,010 --> 00:08:36,320
I apologize for that little quick aside I just had to mention it I felt compelled like I mentioned.

126
00:08:36,680 --> 00:08:36,920
All right.

127
00:08:36,920 --> 00:08:39,140
So looks like everything successfully got installed.

128
00:08:39,850 --> 00:08:43,100
So now to make sure everything is set up correctly I'll do the command.

129
00:08:43,100 --> 00:08:47,730
Travis like so it's going to ask me if I want to install some shell completion.

130
00:08:47,750 --> 00:08:50,140
This is essentially some autocomplete stuff.

131
00:08:50,240 --> 00:08:53,590
We don't need it because we're just running like one or two commands here.

132
00:08:53,610 --> 00:08:54,650
Soldiers say no.

133
00:08:55,660 --> 00:09:00,400
And then after that I'll get prompted here with the list of all the commands that are available to me

134
00:09:00,430 --> 00:09:03,300
tied to the Travis Selye OK.

135
00:09:03,300 --> 00:09:08,310
So Travis is definitely up and running successfully without us having to go through that long process

136
00:09:08,310 --> 00:09:09,750
of installing Ruby.

137
00:09:09,750 --> 00:09:13,710
Now let's take a quick pause right here and come back the next section and we're going to continue going

138
00:09:13,710 --> 00:09:15,390
through a couple of other steps.

139
00:09:15,390 --> 00:09:17,260
So quick break and I'll see you in just a minute.
