-: In the last section, we were able to verify
that our deployment works successfully
and so I now see my React application on the screen.
Now, we've still got a couple tasks ahead of us.
The first thing I wanna do
is give you a really rock solid workflow
for making updates to your application
after it's been deployed.
Now, to be truthful, the process of making updates
is going to be identical
to the processes we looked at before.
No big changes whatsoever but nonetheless,
I wanna walk you through these steps
just to make sure they are crystal clear.
So here's the general idea of what we're gonna do.
We're going to check out a Git branch
where we're going to make all of our changes.
We'll then commit those changes,
push those changes up to GitHub
and then create a PR to merge our branch into master.
Remember, we generally treat master
as like the perfect branch
and whatever code is on master
should be the same code that is currently deployed.
After we create the PR,
we'll then wait for our tests to show up green
after they've been ran by Travis CI.
Remember, Travis CI's gonna run your tests
for every single branch that you push up,
and every different pull request
that you create as well.
But it's only going to attempt
to deploy your code after it has been deployed into master.
So we're then going to merge the PR
and then after Travis CI runs a second time
with all of your merged changes,
it's then going to deploy your code
to the Kubernetes cluster
and we should then be able
to see our changes appear on prod.
So let's get to it.
So the change we're going to make is going
to be to our multi-client project again,
just as it was previously.
So I'm going to open up my client directory.
I'll find the SRC folder.
Oh, you know what?
I completely forget the first step.
We wanna check out a branch.
Let's do that first.
All right, so back inside of my terminal,
I'll check out a branch with Git branch,
Git checkout -b,
and then the name of the branch.
Let's also call this like devel,
short for develop.
So we're gonna make our changes to the devel branch
and then we'll eventually commit our changes
and push those up.
All right, so now we can go back over to our code editor.
I'll find the client SRC folder.
And then the app.js file.
So you'll recall inside of here, we have that h1 tag
that currently says fit calculator version two.
We're gonna change that out
and we'll say version Kubernetes.
Just to make sure that it's really clear
that yeah, we made a change here,
rather than trying to remember
what version number we put in there.
Now, I'm gonna save this file.
So definitely saved it.
Next up, I'm going to commit my changes,
and then push that branch up to GitHub.
So back at my terminal, I'll do a Git status
and say yep, I changed that file.
I'll do a Git add and a commit.
And then I'll push it up to GitHub
with Git push origin devel.
All right, so I've now successfully pushed those changes,
so now I'm going to open up my project on GitHub
and create a pull request to merge my code
into the master branch.
So I'll go to GitHub.
My multik8s project.
You'll notice that I see a little popup
right here automatically
that says compare and pull request.
Just to make sure that you understand
how to create a pull request
without getting that nice little popup right there,
we'll do it the more manual fashion.
So we'll go to the pull request tab.
I'll then click on New Pull Request
and then we want to take our compare
of devel and attempt to merge it into master.
And I'll click on create pull request right there.
Now if I want to,
I can add in a message describing the changes.
I could put in something like change the header
of the app.js file.
Whatever you wanna do.
And then I'll create the pull request.
Now, once the pull request has been created,
we then wait on Travis CI to run our tests.
Now, you'll notice that there's two sets
of waits right here from Travis CI.
We get one from just pushing our code,
and then a second change set
from the pull request we just created.
If we wanted to, we could disable Travis CI
from testing our code anytime we push code
or push the branch
and we can make sure that it only tries
to build our code when we create a PR
but that's kind of a personal preference.
I leave it up to you
on what you might want to do there.
So I'm just gonna wait for a minute.
I'm gonna let all this stuff run.
When we come back in the next section,
we're gonna verify
that both these tests completed successfully,
and then we'll start to merge the PR.
Quick pause and I'll see you in just a minute.