Skip to content

Commit

Permalink
MMT-3876: Add deployment command outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
htranho committed Nov 26, 2024
1 parent e8f34de commit 3e0c0f1
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions bin/download_schemas.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
#!/bin/bash
ummJsonSchemaUrl=`jq '.ummJsonSchemaUrl' ./static.config.json`
ummJsonSchemaUrl=${ummJsonSchemaUrl//\"/}
bamboo_STAGE_NAME="sit"
stage=$bamboo_STAGE_NAME
if [ "$stage" == "prod" ]; then
stage=""
fi
if [[ "$stage" == "sit" || "$stage" == "uat" ]]; then
stage="${stage}."
fi
echo "stage=${stage}"
ummC() {
echo "Downloading ummC"
#Reads version number
schema_version=`jq '.ummVersions.ummC' ./static.config.json`
schema_version=${schema_version//\"/}
echo ummC schema version=${schema_version}
#Download
curl -L "https://cdn.${stage}earthdata.nasa.gov/umm/collection/v${schema_version}/umm-c-json-schema.json" > umm-c-json-schema-temp.json
downloadURL="https://cdn.${stage}earthdata.nasa.gov/umm/collection/v${schema_version}/umm-c-json-schema.json"
echo "download URL=${downloadURL}"
curl -L "${downloadURL}" > umm-c-json-schema-temp.json
if [ $? -ne 0 ]; then
echo "Failed downloading umm-c-json-schema.json"
exit 1
fi
jq --arg ummJsonSchemaUrl "$ummJsonSchemaUrl" '."$schema" = $ummJsonSchemaUrl' umm-c-json-schema-temp.json > umm-c-json-schema.json
curl -L "https://cdn.${stage}earthdata.nasa.gov/umm/collection/v${schema_version}/umm-cmn-json-schema.json" > umm-cmn-json-schema-temp.json
downloadURL="https://cdn.${stage}earthdata.nasa.gov/umm/collection/v${schema_version}/umm-cmn-json-schema.json"
echo "download URL=${downloadURL}"
curl -L "${downloadURL}" > umm-cmn-json-schema-temp.json
if [ $? -ne 0 ]; then
echo "Failed downloading umm-cmn-json-schema.json"
exit 1
Expand All @@ -43,7 +47,9 @@ ummS() {
schema_version=${schema_version//\"/}
echo ummS schema version=${schema_version}
#Download
curl -L "https://cdn.${stage}earthdata.nasa.gov/umm/service/v${schema_version}/umm-s-json-schema.json" > umm-s-json-schema-temp.json
downloadURL="https://cdn.${stage}earthdata.nasa.gov/umm/service/v${schema_version}/umm-s-json-schema.json"
echo "download URL=${downloadURL}"
curl -L "${downloadURL}" > umm-s-json-schema-temp.json
if [ $? -ne 0 ]; then
echo "Failed downloading umm-s-json-schema.json"
exit 1
Expand All @@ -61,7 +67,9 @@ ummV() {
schema_version=${schema_version//\"/}
echo ummV schema version=${schema_version}
#Download
curl -L "https://cdn.${stage}earthdata.nasa.gov/umm/variable/v${schema_version}/umm-var-json-schema.json" > umm-var-json-schema-temp.json
downloadURL="https://cdn.${stage}earthdata.nasa.gov/umm/variable/v${schema_version}/umm-var-json-schema.json"
echo "download URL=${downloadURL}"
curl -L "${downloadURL}" > umm-var-json-schema-temp.json
if [ $? -ne 0 ]; then
echo "Failed downloading umm-var-json-schema.json"
exit 1
Expand All @@ -79,7 +87,9 @@ ummT() {
schema_version=${schema_version//\"/}
echo ummT schema version=${schema_version}
#Download
curl -L "https://cdn.${stage}earthdata.nasa.gov/umm/tool/v${schema_version}/umm-t-json-schema.json" > umm-t-json-schema-temp.json
downloadURL="https://cdn.${stage}earthdata.nasa.gov/umm/tool/v${schema_version}/umm-t-json-schema.json"
echo "download URL=${downloadURL}"
curl -L "${downloadURL}" > umm-t-json-schema-temp.json
if [ $? -ne 0 ]; then
echo "Failed downloading umm-t-json-schema.json"
exit 1
Expand Down

0 comments on commit 3e0c0f1

Please sign in to comment.