poststartup script moved to extra container, non init
This commit is contained in:
parent
ffc784d4cd
commit
30cf1c8fe3
@ -179,7 +179,7 @@ extraContainers:
|
|||||||
- /bin/bash
|
- /bin/bash
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
set -ex
|
set -ex
|
||||||
echo "[template-loader] Waiting for Elasticsearch at $ES_URL..."
|
echo "[template-loader] Waiting for Elasticsearch at $ES_URL..."
|
||||||
for i in $(seq 1 ${MAX_RETRIES:-30}); do
|
for i in $(seq 1 ${MAX_RETRIES:-30}); do
|
||||||
if curl -s "$ES_URL" >/dev/null; then
|
if curl -s "$ES_URL" >/dev/null; then
|
||||||
@ -189,12 +189,12 @@ extraContainers:
|
|||||||
echo "[template-loader] Attempt $i: ES not ready, sleeping..."
|
echo "[template-loader] Attempt $i: ES not ready, sleeping..."
|
||||||
sleep "${RETRY_INTERVAL:-5}"
|
sleep "${RETRY_INTERVAL:-5}"
|
||||||
done
|
done
|
||||||
echo "[template-loader] Applying templates..."
|
echo "[template-loader] Applying index templates..."
|
||||||
for idx in "chat:$TEMPLATE_PATH_1" "message:$TEMPLATE_PATH_2" "user:$TEMPLATE_PATH_3"; do
|
for idx in "chat:$TEMPLATE_PATH_1" "message:$TEMPLATE_PATH_2" "user:$TEMPLATE_PATH_3"; do
|
||||||
name="${idx%%:*}"
|
name="${idx%%:*}"
|
||||||
path="${idx##*:}"
|
path="${idx##*:}"
|
||||||
echo "[template-loader] Applying $name from $path..."
|
echo "[template-loader] Applying template: $name from $path..."
|
||||||
curl -X PUT "$ES_URL/$name" \
|
curl -X PUT "$ES_URL/_index_template/$name" \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
--data-binary @"$path"
|
--data-binary @"$path"
|
||||||
done
|
done
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user