Skip to content

Commit

Permalink
Update Scorpio
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Jan 3, 2024
1 parent 72a283a commit 4a52be0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ STELLIO_DOCKER_TAG=2.10.2
STELLIO_PORT=8080
STELLIO_TIMESCALE_POSTGIS=14-2.11.1-3.3

# Curl variables
CURL_VERSION=8.4.0

# MongoDB variables
MONGO_DB_PORT=27017
Expand Down
14 changes: 7 additions & 7 deletions services
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pause(){
}

getHeartbeat(){
eval "response=$(docker run --network fiware_default --rm quay.io/curl/curl -s -o /dev/null -w "%{http_code}" "$1")"
eval "response=$(docker run --network fiware_default --rm quay.io/curl/curl:${CURL_VERSION} -s -o /dev/null -w "%{http_code}" "$1")"
}

waitForOrion () {
Expand Down Expand Up @@ -66,14 +66,14 @@ waitForScorpio () {
waitForStellio () {
echo -e "\n⏳ Waiting for \033[1;34mStellio\033[0m to respond\n"
waitSeconds=30
while [ `docker run --network fiware_default --rm quay.io/curl/curl -s -o /dev/null -w %{http_code} 'http://stellio:8080/ngsi-ld/v1/entities/?type=X'` -eq 000 ]
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 ]
do
echo -e "Context Broker HTTP state: " `curl -s -o /dev/null -w %{http_code} 'http://localhost:8080/ngsi-ld/v1/entities/?type=X'` " (waiting for 500)"
echo -e "Waiting for ${waitSeconds} seconds ..."
sleep ${waitSeconds}
done
echo -e "\n⏳ Waiting for all \033[1;34mStellio\033[0m services to be available\n"
while [ `docker run --network fiware_default --rm quay.io/curl/curl -s -o /dev/null -w %{http_code} 'http://stellio:8080/ngsi-ld/v1/entities/?type=X'` -eq 500 ]
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 ]
do
echo -e "Context Broker HTTP state: " `curl -s -o /dev/null -w %{http_code} 'http://localhost:8080/ngsi-ld/v1/entities/?type=X'` " (waiting for 200)"
echo -e "Waiting for ${waitSeconds} seconds ..."
Expand All @@ -83,12 +83,12 @@ waitForStellio () {

waitForCoreContext () {
echo -e "\n⏳ Checking availability of \033[1m core @context\033[0m from ETSI\n"
eval "response=$(docker run --rm quay.io/curl/curl -s -o /dev/null -w "%{http_code}" "$CORE_CONTEXT")"
eval "response=$(docker run --rm quay.io/curl/curl:${CURL_VERSION} -s -o /dev/null -w "%{http_code}" "$CORE_CONTEXT")"
while [ "${response}" -eq 000 ]
do
echo -e "\n@context HTTP state: ${response} (waiting for 200)"
pause 3
eval "response=$(docker run --rm quay.io/curl/curl -s -o /dev/null -w "%{http_code}" "$CORE_CONTEXT")"
eval "response=$(docker run --rm quay.io/curl/curl:${CURL_VERSION} -s -o /dev/null -w "%{http_code}" "$CORE_CONTEXT")"
done
}

Expand Down Expand Up @@ -118,7 +118,7 @@ loadData () {
--network fiware_default \
-e CONTEXT_BROKER=${CONTEXT_BROKER} \
-e TUTORIAL_DATA_MODELS_CONTEXT=${CONTEXT} \
--entrypoint /bin/ash quay.io/curl/curl /import-data
--entrypoint /bin/ash quay.io/curl/curl:${CURL_VERSION} /import-data
}

addDatabaseIndex () {
Expand Down Expand Up @@ -230,7 +230,7 @@ case "${command}" in
"create")
export $(cat .env | grep "#" -v)
echo "Pulling Docker images"
docker pull -q quay.io/curl/curl
docker pull -q quay.io/curl/curl:${CURL_VERSION}
${dockerCmd} -f docker-compose/common.yml -f docker-compose/scorpio.yml -f docker-compose/orion-ld.yml -f docker-compose/stellio.yml pull
;;
*)
Expand Down

0 comments on commit 4a52be0

Please sign in to comment.