aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb
blob: 9f6646d63dff600be00a5a2cea9a6a5b67ef4aa3 (plain)
1
2
3
4
5
6
7
8
9
#!/bin/bash
health_check_http_code=$(curl -k --max-time 5 -o /dev/null -w '%{http_code}' <%= @protocol %>://127.0.0.1:<%= @port %>/sdc2/rest/healthCheck)

if [[ "$health_check_http_code" -eq 200 ]]; then
  exit 0
else
  echo "Health check http status: $health_check_http_code"
  exit 1
fi
lass="mi">4 replication_factor=3 else replication_factor=4 end template "titan.properties" do path "#{ENV['JETTY_BASE']}/config/catalog-be/titan.properties" source "BE-titan.properties.erb" owner "jetty" group "jetty" mode "0755" variables({ :CASSANDRA_IP => node['Nodes']['CS'], :CASSANDRA_PWD => node['cassandra'][:cassandra_password], :CASSANDRA_USR => node['cassandra'][:cassandra_user], :rep_factor => replication_factor, :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment, :titan_connection_timeout => node['cassandra']['titan_connection_timeout'], :cassandra_traststore_password => node['cassandra'][:truststore_password], :cassandra_ssl_enabled => "#{ENV['cassandra_ssl_enabled']}" }) end template "catalog-be-config" do path "#{ENV['JETTY_BASE']}/config/catalog-be/configuration.yaml" source "BE-configuration.yaml.erb" owner "jetty" group "jetty" mode "0755" variables({ :catalog_ip => node['Nodes']['BE'], :catalog_port => node['BE'][:http_port], :ssl_port => node['BE'][:https_port], :cassandra_ip => node['Nodes']['CS'], :rep_factor => replication_factor, :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment, :titan_Path => "/var/lib/jetty/config/catalog-be/", :socket_connect_timeout => node['cassandra']['socket_connect_timeout'], :socket_read_timeout => node['cassandra']['socket_read_timeout'], :cassandra_pwd => node['cassandra'][:cassandra_password], :cassandra_usr => node['cassandra'][:cassandra_user], :cassandra_traststore_password => node['cassandra'][:truststore_password], :cassandra_ssl_enabled => "#{ENV['cassandra_ssl_enabled']}" }) end template "distribution-engine-configuration" do path "#{ENV['JETTY_BASE']}/config/catalog-be/distribution-engine-configuration.yaml" source "BE-distribution-engine-configuration.yaml.erb" owner "jetty" group "jetty" mode "0755" end cookbook_file "ArtifactGenerator" do path "#{ENV['JETTY_BASE']}/config/catalog-be/Artifact-Generator.properties" source "Artifact-Generator.properties" owner "jetty" group "jetty" mode "0755" end