diff --git a/build.sh b/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..e25c16e59c09d5f0de31353794a1e5e491c17b78 --- /dev/null +++ b/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -euo pipefail + +# Install maap-py so we can use MAAP Secrets in run.sh +conda run --no-capture-output --name mytobac python -m pip install maap-py diff --git a/run.sh b/run.sh index 4c5480d27dbb949370a59bccff80ded6869ef3b4..c252ddd874661f51b7529e9580448afb565b045f 100644 --- a/run.sh +++ b/run.sh @@ -1,9 +1,22 @@ #!/bin/bash -basedir=$( cd "$(dirname "$0")" ; pwd -P) +readarray -d " " -t credentials <<<"$( + python -c ' +from maap.maap import MAAP +maap = MAAP() +username = maap.secrets.get_secret("EARTHDATA_USERNAME") +password = maap.secrets.get_secret("EARTHDATA_PASSWORD") +print(username, password) +' +)" -OUTPUTDIR="${PWD}/output" +EARTHDATA_USERNAME=$(echo -e "${credentials[0]}" | tr -d '[:space:]') +EARTHDATA_PASSWORD=$(echo -e "${credentials[1]}" | tr -d '[:space:]') +export EARTHDATA_USERNAME +export EARTHDATA_PASSWORD -ANALYSIS_DATE=$1 +outputdir="${PWD}/output" -conda run --live-stream --name mytobac python /root/aos_test/src/Tracking_Paper_Plots-Lorenzo-aws.py ${ANALYSIS_DATE} \ No newline at end of file +analysis_date=$1 + +conda run --no-capture-output --name mytobac python /root/aos_test/src/Tracking_Paper_Plots-Lorenzo-aws.py "${analysis_date}"