Implementation of a Website Health Checker to improve Continues Delivery processes – Part 3: Jenkins

From this part of the post I will show you in detail the implementations of the individual components. Here I will discuss how to configure the automatic deployment, here jenkins, how exactly the interface is implemented in the web server and the most important part,  how the website health checker is built up exactly.

First, I make the configuration of the jenkins. Here is a simple scenario for how to integrate the desired processes into an existing process pipeline. I’m assuming that a normal pipeline in Jenkins consists of two processes, the build and the subsequent deployment. What I am doing now is to integrate 2 more processes into this pipeline. The first process is after a successful build and before deploying. The second is executed after a successful deployment. In the end, both processes have only the purpose of calling the WebsiteHealthChecker via a provided interface and thus executing the checks. The first process collects information about the current state of the page BEFORE deployment and the second process collects information about the state of the page AFTER deployment and compares it with the results before it. This is already done automatically by the WebsiteHealthChecker, as soon as old results are available, so the interface, which is called from the jenkins, is always the same.

With the Jenkins itself I have decided to put in the processes on the Http-Request module, since it is very easy to handle Http-Request either via GET or POST also with parameters. In Fig. 1, you can see the crucial excerpt from the configuration with which I call the site HealthChecker from the Jenkins.

2016-11-13-17_46_59-cs-relaunch-2015-uat-cm-health-check-config-jenkins
Fig. 1 Configuration of the WebsiteHealthCheckercall

The URL that is being called is:

http://www.websitehealthchecker.int/WebRequest/TriggerWebsiteCheck?InterfaceUrl=http://uat-cm.*********.de/api/sitecore/ExternalInterface/GetAllSites&mailIdentifier=uat-cm&MailTo=christian-hahn1@gmx.net

The parameters are interfaceUrl, which represents the interface of the website that provides the URLs to check, mailIdentifier, which serves as a unique identifier for the mail to be sent, and mailTo, which simply indicates the recipient of the mail, in which all the information of the check Are deposited.

All processes in the Jenkins together can be seen in Fig.2. There are the standard build and deployprocesses as well as the two new test processes, which are all executed automatically in the correct order.

2016-11-13-17_45_49-corpus-sireo-relaunch-website-2015-jenkins
Fig. 2 Processes in Jenkins for Continues Delivery processes

As soon as these processes have been completed and the Healtch Check has been carried out, the registered recipient receives an e-mail containing the most important basic information of the last check. In Fig. 3 you can see an example of such an e-mail.

2016-11-13 18_00_25-Website Health Checker Results - www.corpus-sireo.com - christian.hahn@ecx.io - .png
Fig. 3 Abstract of the Mail of the Health Checker

In this mail, the two types of confirmations can be seen. On the one hand, the message NOT REACHABLE, which always appears when a particular URL is not available. On the other hand, the message COMPARE CHANGED, which always appears, if the comparison of the current check to the last shows a difference either in the status code, in the browsertitel, in the markup or in the screenshot. Thus in the confirmation mail, only critical entries appear which potentially present a fault and need a more detailed examination.

In Part 4 I will explain in detail the interface of the website to check, especially the functionality with our Sitecore CMS.