Skip to content

Commit 666356f

Browse files
committed
Amend variable loading
1 parent f5d04fd commit 666356f

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

services

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ getHeartbeat(){
4444
waitForOrion () {
4545
echo -e "\n⏳ Waiting for \033[1;34mOrion-LD\033[0m to be available\n"
4646

47-
while ! [ `docker inspect --format='{{.State.Health.Status}}' fiware-orion` == "healthy" ]
47+
while ! [ "$(docker inspect --format='{{.State.Health.Status}}' fiware-orion)" == "healthy" ]
4848
do
4949
echo -e "\nContext Broker HTTP state: ${response} (waiting for 200)"
5050
pause 6
@@ -66,16 +66,16 @@ waitForScorpio () {
6666
waitForStellio () {
6767
echo -e "\n⏳ Waiting for \033[1;34mStellio\033[0m to respond\n"
6868
waitSeconds=30
69-
while [ `docker run --network fiware_default --rm quay.io/curl/curl:${CURL_VERSION} -s -o /dev/null -w %{http_code} 'http://stellio:8080/ngsi-ld/v1/entities/?type=X'` -eq 000 ]
69+
while [ "$(docker run --network fiware_default --rm quay.io/curl/curl:${CURL_VERSION} -s -o /dev/null -w %{http_code} 'http://stellio:8080/ngsi-ld/v1/entities/?type=X')" -eq 000 ]
7070
do
71-
echo -e "Context Broker HTTP state: " `curl -s -o /dev/null -w %{http_code} 'http://stellio:8080/ngsi-ld/v1/entities/?type=X'` " (waiting for 500)"
71+
echo -e "Context Broker HTTP state: " $(curl -s -o /dev/null -w %{http_code} 'http://stellio:8080/ngsi-ld/v1/entities/?type=X') " (waiting for 500)"
7272
echo -e "Waiting for ${waitSeconds} seconds ..."
7373
sleep ${waitSeconds}
7474
done
7575
echo -e "\n⏳ Waiting for all \033[1;34mStellio\033[0m services to be available\n"
76-
while [ `docker run --network fiware_default --rm quay.io/curl/curl:${CURL_VERSION} -s -o /dev/null -w %{http_code} 'http://stellio:8080/ngsi-ld/v1/entities/?type=X'` -eq 500 ]
76+
while [ "$(docker run --network fiware_default --rm quay.io/curl/curl:${CURL_VERSION} -s -o /dev/null -w %{http_code} 'http://stellio:8080/ngsi-ld/v1/entities/?type=X')" -eq 500 ]
7777
do
78-
echo -e "Context Broker HTTP state: " `curl -s -o /dev/null -w %{http_code} 'http://stellio:8080/ngsi-ld/v1/entities/?type=X'` " (waiting for 200)"
78+
echo -e "Context Broker HTTP state: " $(curl -s -o /dev/null -w %{http_code} 'http://stellio:8080/ngsi-ld/v1/entities/?type=X') " (waiting for 200)"
7979
echo -e "Waiting for ${waitSeconds} seconds ..."
8080
sleep ${waitSeconds}
8181
done
@@ -105,7 +105,7 @@ waitForUserContext () {
105105

106106
waitForMongo () {
107107
echo -e "\n⏳ Waiting for \033[1mMongoDB\033[0m to be available\n"
108-
while ! [ `docker inspect --format='{{.State.Health.Status}}' db-mongo` == "healthy" ]
108+
while ! [ "$(docker inspect --format='{{.State.Health.Status}}' db-mongo)" == "healthy" ]
109109
do
110110
sleep 1
111111
done
@@ -142,7 +142,7 @@ case "${command}" in
142142
exit 0;
143143
;;
144144
"orion")
145-
export $(cat .env | grep "#" -v)
145+
set -a; source .env; set +a
146146
stoppingContainers
147147
waitForCoreContext
148148
echo -e "Starting containers: \033[1;34mOrion-LD\033[0m, a linked data \033[1mContext\033[0m and a \033[1;30mMongoDB\033[0m database."
@@ -157,7 +157,7 @@ case "${command}" in
157157
echo -e "\033[1;34m${command}\033[0m is now running and exposed on localhost:${EXPOSED_PORT}"
158158
;;
159159
"scorpio")
160-
export $(cat .env | grep "#" -v)
160+
set -a; source .env; set +a
161161
stoppingContainers
162162
waitForCoreContext
163163
echo -e "Starting containers: \033[1;34mScorpio\033[0m, a linked data \033[1mContext\033[0m and a \033[1mPostgres\033[0m database."
@@ -170,7 +170,7 @@ case "${command}" in
170170
echo -e "\033[1;34m${command}\033[0m is now running and exposed on localhost:${EXPOSED_PORT}"
171171
;;
172172
"stellio")
173-
export $(cat .env | grep "#" -v)
173+
set -a; source .env; set +a
174174
stoppingContainers
175175
waitForCoreContext
176176
echo -e "Starting containers: \033[1;34mStellio\033[0m, \033[1mKafka\033[0m, \033[1mPostgreSQL/TimescaleDB\033[0m, and a linked data \033[1mContext\033[0m."
@@ -183,15 +183,15 @@ case "${command}" in
183183
echo -e "\033[1;34m${command}\033[0m is now running and exposed on localhost:${EXPOSED_PORT}"
184184
;;
185185
"stop")
186-
export $(cat .env | grep "#" -v)
186+
set -a; source .env; set +a
187187
stoppingContainers
188188
;;
189189
"start")
190-
export $(cat .env | grep "#" -v)
190+
set -a; source .env; set +a
191191
./services ${CONTEXT_BROKER:=orion} $2
192192
;;
193193
"create")
194-
export $(cat .env | grep "#" -v)
194+
set -a; source .env; set +a
195195
echo "Pulling Docker images"
196196
docker pull -q quay.io/curl/curl:${CURL_VERSION}
197197
${dockerCmd} -f docker-compose/common.yml -f docker-compose/scorpio.yml -f docker-compose/orion-ld.yml -f docker-compose/stellio.yml pull

0 commit comments

Comments
 (0)