Skip to content

Commit 2411b19

Browse files
author
Mark Markaryan
authored
Allow for ElasticSearch scheme (https, http) to be configurable via container's env var (#563)
1 parent 7278094 commit 2411b19

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docker/start.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -x
55
DB="${DB:-cassandra}"
66
ENABLE_ES="${ENABLE_ES:-false}"
77
ES_PORT="${ES_PORT:-9200}"
8+
ES_SCHEME="${ES_SCHEME:-http}"
89
RF=${RF:-1}
910
DEFAULT_NAMESPACE="${DEFAULT_NAMESPACE:-default}"
1011
DEFAULT_NAMESPACE_RETENTION=${DEFAULT_NAMESPACE_RETENTION:-1}
@@ -67,9 +68,9 @@ setup_postgres_schema() {
6768
setup_es_template() {
6869
SCHEMA_FILE=$TEMPORAL_HOME/schema/elasticsearch/visibility/index_template.json
6970
server=`echo $ES_SEEDS | awk -F ',' '{print $1}'`
70-
URL="http://$server:$ES_PORT/_template/temporal-visibility-template"
71+
URL="${ES_SCHEME}://$server:$ES_PORT/_template/temporal-visibility-template"
7172
curl -X PUT $URL -H 'Content-Type: application/json' --data-binary "@$SCHEMA_FILE"
72-
URL="http://$server:$ES_PORT/temporal-visibility-dev"
73+
URL="${ES_SCHEME}://$server:$ES_PORT/temporal-visibility-dev"
7374
curl -X PUT $URL
7475
}
7576

@@ -120,7 +121,7 @@ wait_for_postgres() {
120121

121122
wait_for_es() {
122123
server=`echo $ES_SEEDS | awk -F ',' '{print $1}'`
123-
URL="http://$server:$ES_PORT"
124+
URL="${ES_SCHEME}://$server:$ES_PORT"
124125
curl -s $URL 2>&1 > /dev/null
125126
until [ $? -eq 0 ]; do
126127
echo 'waiting for elasticsearch to start up'

0 commit comments

Comments
 (0)