1
00:00:01,720 --> 00:00:07,870
In this lecture, we'll take a look at adding another environment to our continuous deployment pipeline.

2
00:00:09,850 --> 00:00:15,520
And if you look back to our original idea between the continuous integration, continuous deployment

3
00:00:15,520 --> 00:00:20,970
pipeline, you can see that more or less the continuous integration pipeline is complete.

4
00:00:20,980 --> 00:00:22,330
At least we have a built stage.

5
00:00:23,470 --> 00:00:28,120
We are having some tests and then we are packaging everything together.

6
00:00:28,390 --> 00:00:34,510
Of course, we do not we don't do anything regarding code quality, but so far we are pretty confident

7
00:00:34,510 --> 00:00:37,510
that whatever are building looks like website.

8
00:00:38,250 --> 00:00:45,700
I want to continue deployment, but we have only added one production system and this makes, first

9
00:00:45,700 --> 00:00:50,770
of all, continuous delivery a bit difficult because we are not actually testing the deployment process.

10
00:00:50,770 --> 00:00:52,980
We are we are directly deploying to production.

11
00:00:53,440 --> 00:01:00,010
And second of all, it doesn't allow us to review the changes that we have made on a similar system

12
00:01:00,010 --> 00:01:00,910
to the production line.

13
00:01:01,780 --> 00:01:07,210
So for that reason, in this lecture, we are going to add a staging environment to our pipeline.

14
00:01:11,120 --> 00:01:15,830
So first of all, let's review the stages that we have so far, and I think it would be a good idea

15
00:01:15,830 --> 00:01:18,670
to make some minor changes to them.

16
00:01:19,160 --> 00:01:25,700
So first of all, deployed now ready for us to deploy to production so we can say here, deploy production.

17
00:01:29,710 --> 00:01:30,250
Partner.

18
00:01:31,250 --> 00:01:35,870
And maybe we can sname deployments like production tests.

19
00:01:38,770 --> 00:01:40,090
So that we know what they are.

20
00:01:41,620 --> 00:01:42,880
The same goes.

21
00:01:44,950 --> 00:01:49,990
Or the new system that we want to introduce, so instead of production, let's name the staging.

22
00:01:54,370 --> 00:02:01,750
So our pipeline will first build, then test, then try to deploy it on staging and after that while

23
00:02:01,750 --> 00:02:03,040
deployed on production.

24
00:02:06,900 --> 00:02:09,810
So let's quickly changed jobs that we have so far.

25
00:02:19,120 --> 00:02:24,160
Now, I'm going to name the job the same as the stage, so the production, diplo production.

26
00:02:27,930 --> 00:02:33,590
And here we'll have to production test as a stage, let's rename that as well.

27
00:02:41,960 --> 00:02:47,690
Now, the deployment process is quite similar to what we have to do now is to duplicate this job.

28
00:02:49,360 --> 00:02:50,830
And simply make some changes.

29
00:02:50,860 --> 00:02:52,240
I'm going to call it.

30
00:02:53,880 --> 00:02:54,900
Deploy staging.

31
00:03:00,630 --> 00:03:05,320
And it will look more or less the same will still need to install surge.

32
00:03:06,240 --> 00:03:09,510
And now let's say that our domain name is.

33
00:03:11,070 --> 00:03:16,980
Is not in the zone because this would be like the production system, so let's call it the Zone Desh

34
00:03:16,980 --> 00:03:20,360
staging or whatever domain name you have selected for yourself.

35
00:03:28,080 --> 00:03:28,870
So far, so good.

36
00:03:30,550 --> 00:03:35,290
Now we have this additional system, and this is good, because even if we do a continuous deployment,

37
00:03:35,950 --> 00:03:42,520
we rarely want to deploy underproduction system and adding this preproduction or testing stage or how

38
00:03:42,520 --> 00:03:47,830
you want to call it anything that is before the production system is a good practice because it allows

39
00:03:47,830 --> 00:03:49,780
us to run some additional tests.

40
00:03:50,500 --> 00:03:54,550
And usually this allows us to run a different kind of tests.

41
00:03:54,550 --> 00:03:57,910
Then we can run only when you are building the package.

42
00:03:58,480 --> 00:04:03,280
And it's kind of tests are usually called integration or acceptance tests that have different name,

43
00:04:03,610 --> 00:04:09,010
but they can have a general picture on how the system is working.

44
00:04:09,040 --> 00:04:15,490
Now we have a simple website, but usually you may be interacting with other external APIs or other

45
00:04:15,490 --> 00:04:17,560
systems which need to work as well.

46
00:04:18,279 --> 00:04:24,190
And only in such an environment you will have access to the entire system and will be able to tell is

47
00:04:24,190 --> 00:04:25,290
everything working?

48
00:04:25,300 --> 00:04:27,250
Is everything integrating correctly?

49
00:04:27,460 --> 00:04:32,770
So this is why this staging or testing system is necessary.

50
00:04:37,000 --> 00:04:43,240
Now, luckily for us, Gottleib has the concept of environments and what environments allow us to do

51
00:04:43,240 --> 00:04:50,800
is to control the continuous deployment process of our software and it allows us to track our deployments.

52
00:04:51,130 --> 00:04:55,810
And what's more importantly, we sort of we can tag our jobs.

53
00:04:56,080 --> 00:05:02,620
And in this way, we can tell Gottleib what we are doing and then Gottleib will be able to keep track

54
00:05:02,620 --> 00:05:03,550
of what we do.

55
00:05:03,850 --> 00:05:10,030
So we will know what we have currently installed on which system and which worsened and so on.

56
00:05:10,780 --> 00:05:15,490
And there's a small configuration that we need to do in order to take our jobs.

57
00:05:19,470 --> 00:05:23,130
And this can be done by using environment.

58
00:05:26,710 --> 00:05:28,740
And there are two properties that we can define.

59
00:05:28,780 --> 00:05:30,700
First of all, we have to give it a name.

60
00:05:32,560 --> 00:05:34,390
And in this case, it will be staging.

61
00:05:36,810 --> 00:05:42,870
And additionally, we can give it to address and you will see a bit later why this is needed and why

62
00:05:42,870 --> 00:05:44,120
this is useful as well.

63
00:05:52,110 --> 00:05:58,590
So now we have our job and now Gottleib knows what we are doing, we can copy the same configuration

64
00:05:58,590 --> 00:06:01,670
and put it for the deployed to production as well.

65
00:06:15,550 --> 00:06:15,900
Right.

66
00:06:18,090 --> 00:06:20,090
So let's try it out and see how it works.

67
00:06:24,690 --> 00:06:30,540
If you go back to our pipeline and take a look at what has happened, see that in this overview, there's

68
00:06:30,540 --> 00:06:31,220
nothing new.

69
00:06:31,230 --> 00:06:38,090
So we need we have a new stage here, deploy staging, but it pretty much looks the same.

70
00:06:38,100 --> 00:06:42,570
And it seems that what we have did with the environment hasn't really had an effect here.

71
00:06:43,380 --> 00:06:50,730
And in order to see exactly how the environments are now trackable in Gottleib is by going on the left

72
00:06:50,730 --> 00:06:54,030
panel here to operations and environment.

73
00:06:59,450 --> 00:07:07,070
Now, here, you'll be able to see exactly what has gone life, so you see the two environments that

74
00:07:07,070 --> 00:07:09,890
we have defined staging and production.

75
00:07:10,910 --> 00:07:16,520
You have the possibility of directly viewing that environment by clicking this button and you will open

76
00:07:16,520 --> 00:07:17,620
the living environment.

77
00:07:17,630 --> 00:07:20,090
And this is why it's useful to provide the URL.

78
00:07:21,500 --> 00:07:24,260
And he will tell you which committee has been deployed.

79
00:07:26,330 --> 00:07:34,310
So it's a very handy feature and we'll definitely use it in the future as we add more systems and want

80
00:07:34,310 --> 00:07:36,020
to keep track of what's going on here.

81
00:07:36,800 --> 00:07:41,330
Feel free to play around and make some deployments and get a better understanding on how the environments

82
00:07:41,330 --> 00:07:41,630
work.

