Skip to content
Snippets Groups Projects
entrypoint.sh 648 B
Newer Older
#!/bin/bash

set -e
set -u
set -o pipefail

# export default env vars
export COPERNICUS_LOGIN=${COPERNICUS_LOGIN:-""}
export COPERNICUS_PASSWORD=${COPERNICUS_PASSWORD:-""}
export SIMULATION_NUM_DAYS=${SIMULATION_NUM_DAYS:-3} # number of days to simulate
export START_DATE=${START_DATE:-"$(date +%FT00:00:00.000000Z)"} # start date of simulation
export END_DATE=${END_DATE:-"$(date --date="+${SIMULATION_NUM_DAYS} days" +%FT00:00:00.000000Z)"} # end date of simulation

# login to copernicus
copernicusmarine login --username="${COPERNICUS_LOGIN}" --password="${COPERNICUS_PASSWORD}" -overwrite

# download forcing