WEBVTT

00:00.600 --> 00:02.280
-: In the last section, we were able to verify

00:02.280 --> 00:04.110
that our deployment works successfully

00:04.110 --> 00:06.750
and so I now see my React application on the screen.

00:06.750 --> 00:08.970
Now, we've still got a couple tasks ahead of us.

00:08.970 --> 00:09.810
The first thing I wanna do

00:09.810 --> 00:12.420
is give you a really rock solid workflow

00:12.420 --> 00:14.490
for making updates to your application

00:14.490 --> 00:15.900
after it's been deployed.

00:15.900 --> 00:18.300
Now, to be truthful, the process of making updates

00:18.300 --> 00:19.350
is going to be identical

00:19.350 --> 00:21.180
to the processes we looked at before.

00:21.180 --> 00:23.220
No big changes whatsoever but nonetheless,

00:23.220 --> 00:24.360
I wanna walk you through these steps

00:24.360 --> 00:26.730
just to make sure they are crystal clear.

00:26.730 --> 00:29.010
So here's the general idea of what we're gonna do.

00:29.010 --> 00:31.140
We're going to check out a Git branch

00:31.140 --> 00:33.210
where we're going to make all of our changes.

00:33.210 --> 00:34.950
We'll then commit those changes,

00:34.950 --> 00:36.930
push those changes up to GitHub

00:36.930 --> 00:40.770
and then create a PR to merge our branch into master.

00:40.770 --> 00:42.510
Remember, we generally treat master

00:42.510 --> 00:44.220
as like the perfect branch

00:44.220 --> 00:46.140
and whatever code is on master

00:46.140 --> 00:48.693
should be the same code that is currently deployed.

00:49.860 --> 00:51.060
After we create the PR,

00:51.060 --> 00:53.460
we'll then wait for our tests to show up green

00:53.460 --> 00:55.830
after they've been ran by Travis CI.

00:55.830 --> 00:58.110
Remember, Travis CI's gonna run your tests

00:58.110 --> 01:00.420
for every single branch that you push up,

01:00.420 --> 01:02.070
and every different pull request

01:02.070 --> 01:03.360
that you create as well.

01:03.360 --> 01:04.800
But it's only going to attempt

01:04.800 --> 01:08.160
to deploy your code after it has been deployed into master.

01:08.160 --> 01:10.080
So we're then going to merge the PR

01:10.080 --> 01:12.930
and then after Travis CI runs a second time

01:12.930 --> 01:14.520
with all of your merged changes,

01:14.520 --> 01:16.450
it's then going to deploy your code

01:16.450 --> 01:18.030
to the Kubernetes cluster

01:18.030 --> 01:18.863
and we should then be able

01:18.863 --> 01:21.030
to see our changes appear on prod.

01:21.030 --> 01:22.083
So let's get to it.

01:23.340 --> 01:24.810
So the change we're going to make is going

01:24.810 --> 01:27.030
to be to our multi-client project again,

01:27.030 --> 01:28.800
just as it was previously.

01:28.800 --> 01:31.470
So I'm going to open up my client directory.

01:31.470 --> 01:33.060
I'll find the SRC folder.

01:33.060 --> 01:33.893
Oh, you know what?

01:33.893 --> 01:34.830
I completely forget the first step.

01:34.830 --> 01:36.030
We wanna check out a branch.

01:36.030 --> 01:37.740
Let's do that first.

01:37.740 --> 01:40.110
All right, so back inside of my terminal,

01:40.110 --> 01:43.860
I'll check out a branch with Git branch,

01:43.860 --> 01:45.870
Git checkout -b,

01:45.870 --> 01:47.220
and then the name of the branch.

01:47.220 --> 01:49.110
Let's also call this like devel,

01:49.110 --> 01:50.430
short for develop.

01:50.430 --> 01:53.730
So we're gonna make our changes to the devel branch

01:53.730 --> 01:55.320
and then we'll eventually commit our changes

01:55.320 --> 01:56.670
and push those up.

01:56.670 --> 01:59.340
All right, so now we can go back over to our code editor.

01:59.340 --> 02:01.683
I'll find the client SRC folder.

02:02.520 --> 02:04.830
And then the app.js file.

02:04.830 --> 02:07.860
So you'll recall inside of here, we have that h1 tag

02:07.860 --> 02:11.040
that currently says fit calculator version two.

02:11.040 --> 02:12.000
We're gonna change that out

02:12.000 --> 02:15.690
and we'll say version Kubernetes.

02:15.690 --> 02:17.130
Just to make sure that it's really clear

02:17.130 --> 02:18.570
that yeah, we made a change here,

02:18.570 --> 02:19.500
rather than trying to remember

02:19.500 --> 02:21.720
what version number we put in there.

02:21.720 --> 02:23.310
Now, I'm gonna save this file.

02:23.310 --> 02:24.460
So definitely saved it.

02:26.160 --> 02:29.010
Next up, I'm going to commit my changes,

02:29.010 --> 02:32.040
and then push that branch up to GitHub.

02:32.040 --> 02:34.380
So back at my terminal, I'll do a Git status

02:34.380 --> 02:37.170
and say yep, I changed that file.

02:37.170 --> 02:39.483
I'll do a Git add and a commit.

02:43.860 --> 02:45.210
And then I'll push it up to GitHub

02:45.210 --> 02:47.643
with Git push origin devel.

02:50.760 --> 02:53.010
All right, so I've now successfully pushed those changes,

02:53.010 --> 02:55.770
so now I'm going to open up my project on GitHub

02:55.770 --> 02:58.200
and create a pull request to merge my code

02:58.200 --> 03:00.180
into the master branch.

03:00.180 --> 03:01.533
So I'll go to GitHub.

03:04.710 --> 03:06.780
My multik8s project.

03:06.780 --> 03:08.190
You'll notice that I see a little popup

03:08.190 --> 03:09.210
right here automatically

03:09.210 --> 03:11.400
that says compare and pull request.

03:11.400 --> 03:12.600
Just to make sure that you understand

03:12.600 --> 03:13.950
how to create a pull request

03:13.950 --> 03:15.720
without getting that nice little popup right there,

03:15.720 --> 03:17.880
we'll do it the more manual fashion.

03:17.880 --> 03:20.220
So we'll go to the pull request tab.

03:20.220 --> 03:22.860
I'll then click on New Pull Request

03:22.860 --> 03:25.710
and then we want to take our compare

03:25.710 --> 03:28.833
of devel and attempt to merge it into master.

03:30.600 --> 03:33.453
And I'll click on create pull request right there.

03:34.920 --> 03:35.753
Now if I want to,

03:35.753 --> 03:38.010
I can add in a message describing the changes.

03:38.010 --> 03:40.920
I could put in something like change the header

03:40.920 --> 03:43.890
of the app.js file.

03:43.890 --> 03:45.240
Whatever you wanna do.

03:45.240 --> 03:47.140
And then I'll create the pull request.

03:48.990 --> 03:50.910
Now, once the pull request has been created,

03:50.910 --> 03:54.120
we then wait on Travis CI to run our tests.

03:54.120 --> 03:55.830
Now, you'll notice that there's two sets

03:55.830 --> 03:58.290
of waits right here from Travis CI.

03:58.290 --> 04:00.600
We get one from just pushing our code,

04:00.600 --> 04:02.400
and then a second change set

04:02.400 --> 04:04.410
from the pull request we just created.

04:04.410 --> 04:06.600
If we wanted to, we could disable Travis CI

04:06.600 --> 04:09.330
from testing our code anytime we push code

04:09.330 --> 04:10.290
or push the branch

04:10.290 --> 04:11.550
and we can make sure that it only tries

04:11.550 --> 04:13.560
to build our code when we create a PR

04:13.560 --> 04:15.360
but that's kind of a personal preference.

04:15.360 --> 04:16.290
I leave it up to you

04:16.290 --> 04:18.240
on what you might want to do there.

04:18.240 --> 04:19.590
So I'm just gonna wait for a minute.

04:19.590 --> 04:21.000
I'm gonna let all this stuff run.

04:21.000 --> 04:22.260
When we come back in the next section,

04:22.260 --> 04:23.093
we're gonna verify

04:23.093 --> 04:25.230
that both these tests completed successfully,

04:25.230 --> 04:27.240
and then we'll start to merge the PR.

04:27.240 --> 04:29.540
Quick pause and I'll see you in just a minute.
