FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 85a3f9f4 authored by L. Bower's avatar L. Bower
Browse files

modifying docker launch script to pass through optional args from command line

parent cf14a8fe
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
set -e
upload=''
islive='--islive'
clearup='--clearup'
component='not_set'
config='/storage/app/EWS_prod/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json' # default
rundate=$(date '+%Y%m%d') # default today
optionalArgs=""
SHORT=p:,c:,s:,h
LONG=component:,config:,rundate::,help
OPTS=$(getopt -a -n weather --options $SHORT --longoptions $LONG -- "$@")
SHORT=p:c:s:h
LONG=component:,config:,rundate:,noupload::,islive::,clearup::,help
OPTS=$(getopt -a --options $SHORT --longoptions $LONG -- "$@")
echo $OPTS
eval set -- "$OPTS"
while :
......@@ -28,6 +28,18 @@ do
rundate="$2"
shift 2
;;
--noupload )
optionalArgs="$optionalArgs --noupload"
shift 2;
;;
--islive )
optionalArgs="$optionalArgs --islive"
shift 2;
;;
--clearup )
optionalArgs="$optionalArgs --clearup"
shift 2;
;;
-h | --help)
"This is a launch script, example usage: runDockerEWS.sh -p Deposition -c -c /<path>/config_EastAfrica_fc_live.json -s 20220808"
exit 2
......@@ -45,17 +57,16 @@ done
function run_coordinator() {
printf "component: %s\nconfig: %s\nrundate: %s\nupload: %s\n" $component $config $rundate $upload;
printf "component: %s\nconfig: %s\nrundate: %s\n" "$component" "$config" "$rundate"
printf "optional args:\n%s\n" "$optionalArgs"
docker container ls;
docker exec \
ews_runner \
/storage/app/EWS_prod/code/coordinator/scripts/run_Processor.sh \
-p $component \
-c $config \
-s $rundate \
$upload \
$islive \
$clearup
-p "$component" \
-c "$config" \
-s "$rundate" \
"$optionalArgs"
}
run_coordinator
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment