1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/documentation/docs/steps/healthExecuteCheck.md
Christopher Fenner f757a0e1d4
fix Markdown issues (#365)
* fix Markdown issue 'Headers should be surrounded by blank lines'

* fix MD012

* fix MD022

* fix MD026

* fix MD007

* fix MD032

* fix MD038

* fix MD040

* fix MD031

* fix MD034

* fix MD004

* fix new findings

* fix MD036

* fix MD038

* fix MD032

* fix MD006
2018-11-06 13:50:09 +01:00

2.4 KiB

healthExecuteCheck

Description

Calls the health endpoint url of the application.

The intention of the check is to verify that a suitable health endpoint is available. Such a health endpoint is required for operation purposes.

This check is used as a real-life test for your productive health endpoints.

!!! note "Check Depth" Typically, tools performing simple health checks are not too smart. Therefore it is important to choose an endpoint for checking wisely.

This check therefore only checks if the application/service url returns `HTTP 200`.

This is in line with health check capabilities of platforms which are used for example in load balancing scenarios. Here you can find an [example for Amazon AWS](http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-healthchecks.html).

Prerequisites

Endpoint for health check is configured.

!!! warning The health endpoint needs to be available without authentication!

!!! tip If using Spring Boot framework, ideally the provided /health endpoint is used and extended by development. Further information can be found in the Spring Boot documenation for Endpoints

Example

Pipeline step:

healthExecuteCheck testServerUrl: 'https://testserver.com'

Parameters

parameter mandatory default possible values
script yes
healthEndpoint no ``
testServerUrl no

Details:

  • script defines the global script environment of the Jenkinsfile run. Typically this is passed to this parameter. This allows the function to access the commonPipelineEnvironment for storing the measured duration.
  • Health check function is called providing full qualified testServerUrl (and optionally with healthEndpoint if endpoint is not the standard url) to the health check.
  • In case response of the call is different than HTTP 200 OK the health check fails and the pipeline stops.

Step configuration

We recommend to define values of step parameters via config.yml file.

In following sections the configuration is possible:

parameter general step stage
script
healthEndpoint X X X
testServerUrl X X X