1
00:00:04,370 --> 00:00:10,700
Well, let's go ahead and use Carl to check the info and health and point toward the respective information,

2
00:00:10,940 --> 00:00:15,860
because this image is based on Alpina Linux, but it doesn't come with Kerl.

3
00:00:16,070 --> 00:00:22,160
So for that reason will have to use the Alpine Linux package manager to install Kerl and to create a

4
00:00:22,320 --> 00:00:26,960
fourth block in order to install these dependencies that are not inside an image.

5
00:00:33,360 --> 00:00:41,250
So this command will install Karl, and now after it has deployed to death, we can use Colonel and

6
00:00:41,250 --> 00:00:47,970
this will be the domain name and we're going to search with GRAP or, for example, the pipeline at.

7
00:00:53,450 --> 00:00:59,240
And the same thing will do in the health and point we're going to search for up.

8
00:01:01,670 --> 00:01:06,620
The next step would be to get the domain name in there multiple ways on how we can do that, wanted

9
00:01:06,620 --> 00:01:12,680
to show you a dynamic way on how we can find out a domain name without defining a variable where you

10
00:01:12,680 --> 00:01:13,880
hardcoded domain name.

11
00:01:14,930 --> 00:01:20,840
The information that we are looking for is already presented after deploying the application, and you

12
00:01:20,840 --> 00:01:27,350
will see here that in this Jason format, the HWC like console gets back to us and says which version

13
00:01:27,350 --> 00:01:29,860
has been deployed and which is the domain name?

14
00:01:30,530 --> 00:01:35,230
Its name will be the canonical name for the domain and you will see its production.

15
00:01:35,240 --> 00:01:42,460
That's something we can later change it to something else and then we will not have to update our pipeline.

16
00:01:43,070 --> 00:01:50,900
That will do next is to pass this June five is tracked this domain name from this property name and

17
00:01:50,900 --> 00:01:53,960
set an environment variable that I'm going to use.

18
00:01:53,960 --> 00:01:59,260
Then with Colonel passing, Jason industrializes typically no easy task.

19
00:01:59,420 --> 00:02:06,770
So for that reason, I'm going to use an additional utility which is called JQ, and this is a Seelie

20
00:02:06,770 --> 00:02:11,270
tool which enables us to quickly extract information from Jason.

21
00:02:12,660 --> 00:02:18,930
Of course, in order to use JQ, you first have to install it, so using the Alpine package manager,

22
00:02:18,930 --> 00:02:20,340
I'm going to install JQ.

23
00:02:21,640 --> 00:02:27,610
And then in order to extract this information from here, they're going to do is I'm going to pipe this

24
00:02:27,610 --> 00:02:29,740
information to JQ.

25
00:02:32,160 --> 00:02:37,970
And I'm going to specify that I'm interested in the property name, as you have seen in the response

26
00:02:37,970 --> 00:02:41,460
to this, and I'm going to use a flag called the output.

27
00:02:45,720 --> 00:02:53,640
Now, I want to wrap this entire command and perceived output in a variable, so A.W., WCL, I will

28
00:02:53,640 --> 00:03:00,480
give this to you and the response back then, this chaston response will be sent to JQ and will be part

29
00:03:00,480 --> 00:03:02,190
to extract only the domain name.

30
00:03:02,550 --> 00:03:06,930
Then in order to use the domain name in Kerl, we have to set it as a variable.

31
00:03:07,140 --> 00:03:13,590
So the syntax in order to do that is to use SI name because this is the name of the variable that we

32
00:03:13,620 --> 00:03:14,250
are going to use.

33
00:03:14,670 --> 00:03:20,880
It calls the line and between parenthesis we're going to put this entire expression here.

34
00:03:21,480 --> 00:03:24,630
So C name equals dollar and this is the expression.

35
00:03:30,550 --> 00:03:36,490
So the way to curl Comen will look like is following, I'm going to use HTP because we need to specify

36
00:03:36,490 --> 00:03:38,980
the protocol, know how to use the variable name.

37
00:03:40,550 --> 00:03:46,730
And then put that recording, if you look in placement, is actuator, health and actuator info.

38
00:03:47,380 --> 00:03:47,740
OK.

39
00:03:49,800 --> 00:03:53,910
This will be info and the other end point will be health.

40
00:03:58,110 --> 00:04:00,730
Finally, if we run this the way it is, it will still fail.

41
00:04:00,930 --> 00:04:05,910
And the reason for that is when we do update environment, this comment isn't instant.

42
00:04:06,060 --> 00:04:12,210
It takes a few moments for this new environment to be populated with the new version of the application

43
00:04:12,210 --> 00:04:14,790
and for all the services to be restarted.

44
00:04:14,970 --> 00:04:18,839
Everything that we do in the background still takes a few seconds.

45
00:04:19,050 --> 00:04:23,370
I notice that the sweet point for this is around 45 seconds.

46
00:04:23,700 --> 00:04:30,300
So for that reason, I'm going to use an additional sleep here that waits for 45 seconds before doing

47
00:04:30,300 --> 00:04:31,320
the curl comment.

48
00:04:33,750 --> 00:04:41,040
Sleep is not an ideal way to do that, you can write an additional script that may test this every five

49
00:04:41,040 --> 00:04:42,250
seconds or something like that.

50
00:04:42,450 --> 00:04:46,500
So using a sleep will overall make the pipeline a bit slower.

51
00:04:46,500 --> 00:04:49,770
But for our case is a quick and easy way.

52
00:04:49,770 --> 00:04:55,170
So if you're not super concerned about the pipeline, waiting for 45 seconds to check if the deployment

53
00:04:55,170 --> 00:04:57,900
was successful, then this is absolutely no issue.

54
00:04:59,300 --> 00:05:01,550
So it's going to save this and then we'll look at the pipeline.

55
00:05:03,000 --> 00:05:07,530
Now, looking at a console log from the diploid job would be able to see that everything was completed

56
00:05:07,530 --> 00:05:08,170
successfully.

57
00:05:08,230 --> 00:05:12,660
So we have deployed version number 10 and then we look at the endpoint point.

58
00:05:12,660 --> 00:05:16,400
You would be able to see that this is version number 10 and the status is up.

59
00:05:16,860 --> 00:05:18,390
Everything seems to be working fine.

60
00:05:18,840 --> 00:05:22,530
When you're writing any kind of tests, you always want to make sure that they fail.

61
00:05:22,830 --> 00:05:27,540
So for that reason, I invite you to reduce the sleep or to remove it altogether so that you can see

62
00:05:27,540 --> 00:05:31,350
the error when the version is different from what you would have expected.

