mirror of
https://github.com/deviantony/docker-elk.git
synced 2025-12-28 00:29:48 +01:00
ci: Accept arbitrary curl arguments for polling
This commit is contained in:
2
.github/workflows/scripts/lib/testing.sh
vendored
2
.github/workflows/scripts/lib/testing.sh
vendored
@@ -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[*]}"
|
||||
|
||||
4
.github/workflows/scripts/run-tests-core.sh
vendored
4
.github/workflows/scripts/run-tests-core.sh
vendored
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user