In the last section we created our service account and we downloaded a case on file that contains some
credentials for that service account.
We now need to download and install the Travis Seelye which is a program that we're going to use to
encrypt that service account based on file and tie it to our Travis C.I. account.
Remember the entire idea behind this is that the Jason File we just download it.
So this one right here has some very sensitive information inside of it.
And we do not want to expose it to the outside world from our get hub account.
All right.
So to download and install the Travis Seelye we can go to get hakama.
Blah blah blah.
And download this thing and install it.
However there's just one little awkward thing about the Travis CLID and that is that requires Rubie
to be installed on your local system.
Now if you're on a Mac OS machine you're in luck because by default Ruby is installed on Mac OS.
However if you are on Windows well life is a little bit harder on Windows.
Installing Ruby is a little bit more challenging and it's kind of a pain in the rear.
Now I would hate to have to go through the installation process with you if you're on Windows because
it is a little bit of a pain and it takes a decent amount of time but there is a little work around
that we can use.
I want you to remember what we've been doing in this entire course.
We've been creating darker images and containers and the entire purpose of these containers is that
we can very easily get some different environment up and running on our local machine with some very
customized dependencies inside that container.
So I think that rather than trying to install Ruby locally on your machine especially if you are on
Windows instead let's try getting a docker image that has Ruby pre-installed inside of it.
So we're going to get an image that has Ruby pre-installed.
Well then open up a shell or a terminal inside that container and then we'll use that to install and
run that Travis Seelye.
There's only a single command we have to run with Travis Seelye Selye essentially you know just the
one command to encrypt that file that we care about.
So we don't really need a persistent version of the Travis Selye to sit around because we just want
to use at one time and then throw it away.
So this would actually be a great use case where we could use a dock or container with Ruby already
installed inside of it to install install Travis Seelye use it to encrypt the file and then throw the
entire container away because we don't need it for anything else.
So let's give this a shot.
Now in the section as we go through this process we are going to be running a good number of commands
and so I wanted to put all the commands up here in all the different steps are going to go through just
in case you are skipping does video rather quickly.
I want to make sure that you don't accidentally skip one of the commands inside of here.
So I would almost recommend that you take a screenshot of this diagram right here just to make sure
that you nail each and every one of these commands.
So the first thing that we're going to do is execute a docker run command the image that we're going
to be running is Ruby version 2.3 and then at the same time we're going to start up a shell inside there.
And we're also going to set up a volume.
The purpose of the volume right here is to eventually get the service account on file inside the container.
Remember this is the file that we want to encrypt.
So we need to make sure that it is available inside the container.
So we're going to use a volume to do that.
Now notice that we're using the dollar sign parentheses interpellation here.
This is only valid if you're on a UNIX based system or if you're on Windows using get bash as your terminal.
If you are on Windows and you're using something like the command line or Cowper's shell you're going
to use curly braces instead.
So just be aware that little difference.
OK so let's get to it.
I'm going to open up my terminal and I'm going to make sure that I'm inside of my complex directory
because we're going to eventually put that JS on file inside of here and encrypt it and we're using
specifically the complex directory because remember we're going to make sure that the volume is available
inside the container.
So do Daka run dash dash V to set up the volume or say sign PWT to say present working directory of
the complex folder or then do a colon and I'm going to map this present working directory of complex
to the folder about app inside the container.
Now we don't actually have any app thing to put inside the container.
I'm just choosing that folder name toll at totally at random.
You could probably figure out a better name but honestly it just doesn't really matter that much.
Well then specify the image of Ruby 2.3 and then the command that I want to run inside of this container
is S.H. to start a shell inside their sung and run this command.
Now when I run the command I immediately get kicked into a terminal right here or a shell inside the
container.
Because I've already downloaded the ruby image in the past for you.
You probably need to download this image and so it's going to take maybe a minute or two to download
the image and then eventually create a container out of it.
So I encourage you to pause if you're right now and just leave it paused until you eventually get into
a shell like so OK.
So if you're now here I'm going to assume that you've successfully gotten into a shell inside the container.
So if we now do an ls we can see that app folder.
So there's the app folder right there.
The one that we just set up as a volume.
If I change into that app folder and I encourage you to do so right now as well so I can to make sure
I'm inside that folder.
I can do an ls and I'll see all of the project folders out of our original complex directory so definitely
worked out pretty well so far.
So now the next thing we're going to do is install Travis.
This is the Travis Selye.
We're installing it by using the program.
Jim Jim is essentially a dependency manager for the Ruby programming language.
So we're using the gym program to install Travis they'll do Jim install Travis and I'll put on no dash.
Dock and no Arye.
And these two flags over here at the right hand side these are 100 percent optional.
They're essentially saying Do not attempt to install any documentation along with this Jim.
It just makes the installation go very very slightly faster.
All right so I got to run this and then we're going to very quickly see everything get installed.
All right.
Now looks like I paused there for a second.
On building native extensions now something kind of interesting.
I want to mention this is a total side topic completely unrelated from all this Travis stuff and you're
probably going to hate me for going on a side topic while we're running all these intense commands.
But I I half do it.
I have to tell you about this side topic.
I feel 100 percent compelled to do so.
So you notice during that entire process it says building native extensions right here.
That's essentially a step we're Ruby and the gym program are taking a bunch of ruby source code files
and essentially compiling them to get them to work on your local system.
Now that's kind of a build step and it requires some modules inside of Ruby to be installed or essentially
is kind of it development programs to be installed with Ruby.
One thing you might notice that's kind of interesting is when we originally ran that Daka run command
right here we specified a image tagged as 2.3 from Ruby.
If you actually open up the docker hub page it's a ducker hub for that Ruby image we just made use of
song in a search for Ruby and then go to the repository right here.
You'll notice that there are a ton of other versions available some of which are tagged as Alpine.
So remember a Alpine version of an image is essentially just saying hey this is a stripped down version
of the image with just the bare minimum required to get this thing running.
Now in our case we had to install a gym that did this extra build step in like I said that requires
some extra packages to be installed with Ruby if we had to use the Alpine version of this Ruby image.
This step right here would have actually completely failed because remember the Alpine version is 100
percent stripped down and so the Alpine version of the Ruby image does not have those extra practice
required to do this step of building a native extension.
So if we had used.
I keep scrolling up because I think the command is up there but it's not.
If we had used an Alpine version like say Alpine 2.3 right here that Jim install step would have failed
because we did not have all the dependencies required to build this Jim.
So this is a great example where the Alpine version of an image is not always the best solution.
Not always the best solution.
OK.
I apologize for that little quick aside I just had to mention it I felt compelled like I mentioned.
All right.
So looks like everything successfully got installed.
So now to make sure everything is set up correctly I'll do the command.
Travis like so it's going to ask me if I want to install some shell completion.
This is essentially some autocomplete stuff.
We don't need it because we're just running like one or two commands here.
Soldiers say no.
And then after that I'll get prompted here with the list of all the commands that are available to me
tied to the Travis Selye OK.
So Travis is definitely up and running successfully without us having to go through that long process
of installing Ruby.
Now let's take a quick pause right here and come back the next section and we're going to continue going
through a couple of other steps.
So quick break and I'll see you in just a minute.