|
5 | 5 | # For this tutorial the commands are merely a convenience script to run docker compose |
6 | 6 | # |
7 | 7 |
|
8 | | -set -e |
| 8 | +set -eo pipefail |
9 | 9 |
|
10 | 10 | SCORPIO="http://scorpio:9090/" |
11 | 11 | ORION="http://orion:1026/version" |
12 | 12 | ORION2="http://orion2:1026/version" |
13 | | -STELLIO="http://localhost:8080/actuator/health" |
| 13 | +STELLIO="http://stellio:8080/actuator/health" |
14 | 14 | CONTEXT="http://context/user-context.jsonld" |
15 | 15 | CORE_CONTEXT="https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld" |
16 | 16 | DATA_LOADER="http://tutorial:3000" |
@@ -41,7 +41,7 @@ pause(){ |
41 | 41 | } |
42 | 42 |
|
43 | 43 | getHeartbeat(){ |
44 | | - eval "response=$(docker run --network fiware_default --rm quay.io/curl/curl:${CURL_VERSION} -s -o /dev/null -w "%{http_code}" "$1")" |
| 44 | + response=$(docker run --network fiware_default --rm "quay.io/curl/curl:${CURL_VERSION}" -s -o /dev/null -w "%{http_code}" "$1") |
45 | 45 | } |
46 | 46 |
|
47 | 47 | waitForOrionLD () { |
@@ -98,12 +98,12 @@ waitForUserContext () { |
98 | 98 |
|
99 | 99 | waitForCoreContext () { |
100 | 100 | echo -e "\n⏳ Checking availability of \033[1m core @context\033[0m from ETSI\n" |
101 | | - eval "response=$(docker run --rm quay.io/curl/curl:${CURL_VERSION} -s -o /dev/null -w "%{http_code}" "$CORE_CONTEXT")" |
| 101 | + response=$(docker run --rm "quay.io/curl/curl:${CURL_VERSION}" -s -o /dev/null -w "%{http_code}" "$CORE_CONTEXT") |
102 | 102 | while [ "${response}" -eq 000 ] |
103 | 103 | do |
104 | 104 | echo -e "\n@context HTTP state: ${response} (waiting for 200)" |
105 | 105 | pause 3 |
106 | | - eval "response=$(docker run --rm quay.io/curl/curl:${CURL_VERSION} -s -o /dev/null -w "%{http_code}" "$CORE_CONTEXT")" |
| 106 | + response=$(docker run --rm "quay.io/curl/curl:${CURL_VERSION}" -s -o /dev/null -w "%{http_code}" "$CORE_CONTEXT") |
107 | 107 | done |
108 | 108 | } |
109 | 109 |
|
@@ -131,12 +131,12 @@ loadData () { |
131 | 131 |
|
132 | 132 | stoppingContainers () { |
133 | 133 | CONTAINERS=$(docker ps -aq) |
134 | | - if [[ -n $CONTAINERS ]]; then |
| 134 | + if [[ -n "$CONTAINERS" ]]; then |
135 | 135 | echo "Stopping containers" |
136 | 136 | docker rm -f $CONTAINERS |
137 | 137 | fi |
138 | 138 | VOLUMES=$(docker volume ls -qf dangling=true) |
139 | | - if [[ -n $VOLUMES ]]; then |
| 139 | + if [[ -n "$VOLUMES" ]]; then |
140 | 140 | echo "Removing old volumes" |
141 | 141 | docker volume rm $VOLUMES |
142 | 142 | fi |
|
0 commit comments