From 6c86599c0352c5d86025495c6379132a0db52934 Mon Sep 17 00:00:00 2001 From: "k.kedron" Date: Thu, 29 Aug 2019 17:05:58 +0200 Subject: Update ready-probe file Update ready-probe file to support the https mode. Issue-ID: SDC-2548 Signed-off-by: Krystian Kedron Change-Id: I78328d7575d202d1d241785e07fb57573ffe2739 --- .../sdc-catalog-be/recipes/BE_9_prepareProbeFile.rb | 12 ++++++++++++ .../sdc-catalog-be/templates/default/ready-probe.sh.erb | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'catalog-be/sdc-backend') diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_9_prepareProbeFile.rb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_9_prepareProbeFile.rb index 14d08be94c..8d42c26acc 100644 --- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_9_prepareProbeFile.rb +++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_9_prepareProbeFile.rb @@ -1,5 +1,17 @@ +if node[:disableHttp] + protocol = "https" + port = "#{node['BE'][:https_port]}" +else + protocol = "http" + port = "#{node['BE'][:http_port]}" +end + template "/var/lib/ready-probe.sh" do source "ready-probe.sh.erb" sensitive true mode 0755 + variables({ + :protocol => protocol, + :port => port + }) end \ No newline at end of file diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb index 9da843152c..b9eb9b0a6a 100644 --- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb +++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb @@ -1,6 +1,6 @@ #!/bin/bash +health_Check_http_code=$(curl -k --max-time 5 -o /dev/null -w '%{http_code}' <%= @protocol %>://127.0.0.1:<%= @port %>/sdc1/rest/healthCheck) -health_Check_http_code=$(curl --max-time 5 -o /dev/null -w '%{http_code}' http://127.0.0.1:8080/sdc2/rest/healthCheck) if [[ "$health_Check_http_code" -eq 200 ]]; then exit 0 else -- cgit 1.2.3-korg