ci: Accept arbitrary curl arguments for polling
This commit is contained in:
parent
95272b72f4
commit
b13d73def4
|
@ -58,7 +58,7 @@ jobs:
|
|||
|
||||
docker-compose up -d elasticsearch
|
||||
source .github/workflows/scripts/lib/testing.sh
|
||||
poll_ready "$(container_id elasticsearch)" "http://$(service_ip elasticsearch):9200/" 'elastic:changeme'
|
||||
poll_ready "$(container_id elasticsearch)" "http://$(service_ip elasticsearch):9200/" -u 'elastic:changeme'
|
||||
|
||||
# Set passwords
|
||||
|
||||
|
@ -206,7 +206,7 @@ jobs:
|
|||
docker stack deploy -c ./docker-stack.yml elk
|
||||
docker service scale elk_logstash=0 elk_kibana=0
|
||||
source .github/workflows/scripts/lib/testing.sh
|
||||
poll_ready "$(container_id elasticsearch)" "http://$(service_ip elasticsearch):9200/" 'elastic:changeme'
|
||||
poll_ready "$(container_id elasticsearch)" "http://$(service_ip elasticsearch):9200/" -u 'elastic:changeme'
|
||||
|
||||
# Set passwords
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ function poll_ready {
|
|||
|
||||
local -a args=( '-s' '-D-' '-m3' '-w' '%{http_code}' "$url" )
|
||||
if [ "$#" -ge 3 ]; then
|
||||
args+=( '-u' "$3" )
|
||||
args+=( ${@:3} )
|
||||
fi
|
||||
|
||||
echo "curl arguments: ${args[*]}"
|
||||
|
|
|
@ -21,13 +21,13 @@ ip_ls="$(service_ip logstash)"
|
|||
ip_kb="$(service_ip kibana)"
|
||||
|
||||
log 'Waiting for readiness of Elasticsearch'
|
||||
poll_ready "$cid_es" "http://${ip_es}:9200/" 'elastic:testpasswd'
|
||||
poll_ready "$cid_es" "http://${ip_es}:9200/" -u 'elastic:testpasswd'
|
||||
|
||||
log 'Waiting for readiness of Logstash'
|
||||
poll_ready "$cid_ls" "http://${ip_ls}:9600/_node/pipelines/main?pretty"
|
||||
|
||||
log 'Waiting for readiness of Kibana'
|
||||
poll_ready "$cid_kb" "http://${ip_kb}:5601/api/status" 'kibana_system:testpasswd'
|
||||
poll_ready "$cid_kb" "http://${ip_kb}:5601/api/status" -u 'kibana_system:testpasswd'
|
||||
|
||||
log 'Creating Logstash index pattern in Kibana'
|
||||
source .env
|
||||
|
|
|
@ -17,10 +17,10 @@ ip_es="$(service_ip elasticsearch)"
|
|||
ip_en="$(service_ip enterprise-search)"
|
||||
|
||||
log 'Waiting for readiness of Elasticsearch'
|
||||
poll_ready "$cid_es" "http://${ip_es}:9200/" 'elastic:testpasswd'
|
||||
poll_ready "$cid_es" "http://${ip_es}:9200/" -u 'elastic:testpasswd'
|
||||
|
||||
log 'Waiting for readiness of Enterprise Search'
|
||||
poll_ready "$cid_en" "http://${ip_en}:3002/api/ent/v1/internal/health" 'elastic:testpasswd'
|
||||
poll_ready "$cid_en" "http://${ip_en}:3002/api/ent/v1/internal/health" -u 'elastic:testpasswd'
|
||||
|
||||
log 'Retrieving private key from Elasticsearch'
|
||||
response="$(curl "http://${ip_es}:9200/.ent-search-actastic-app_search_api_tokens_v2/_search?q=name:private-key" -s -u elastic:testpasswd)"
|
||||
|
|
Loading…
Reference in New Issue