You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 16, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: nancy_run.sh
+28-6Lines changed: 28 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ KEEP_ALIVE=0
16
16
VERBOSE_OUTPUT_REDIRECT=" > /dev/null"
17
17
EBS_SIZE_MULTIPLIER=15
18
18
POSTGRES_VERSION_DEFAULT=10
19
+
AWS_BLOCK_DURATION=0 # by default no time limit
19
20
20
21
#######################################
21
22
# Print an error/warning/notice message to STDERR
@@ -339,6 +340,8 @@ while true; do
339
340
AWS_SSH_KEY_PATH="$2";shift 2 ;;
340
341
--aws-ebs-volume-size )
341
342
AWS_EBS_VOLUME_SIZE="$2";shift 2 ;;
343
+
--aws-block-duration )
344
+
AWS_BLOCK_DURATION=$2;shift 2 ;;
342
345
343
346
--s3cfg-path )
344
347
S3_CFG_PATH="$2";shift 2 ;;
@@ -405,6 +408,7 @@ function checkPath() {
405
408
return 1
406
409
fi
407
410
eval path=\$$1
411
+
408
412
if [[ $path=~"s3://" ]];then
409
413
dbg "$1 looks like a S3 file path. Warning: Its presence will not be checked!"
410
414
return 0 # we do not actually check S3 paths at the moment
@@ -420,7 +424,7 @@ function checkPath() {
420
424
exit 1
421
425
fi
422
426
else
423
-
dbg "Value of $2 is not a file path. Use its value as a content."
427
+
dbg "Value of $1 is not a file path. Use its value as a content."
424
428
return -1 #
425
429
fi
426
430
}
@@ -441,6 +445,19 @@ if [[ "$RUN_ON" == "aws" ]]; then
441
445
err "ERROR: AWS EC2 Instance type not given."
442
446
exit 1
443
447
fi
448
+
if [[ -z${AWS_BLOCK_DURATION+x} ]];then
449
+
err "NOTICE: Container live time duration is not given."
450
+
else
451
+
case$AWS_BLOCK_DURATIONin
452
+
0|60|120|240|300|360)
453
+
dbg "Container live time duration is $AWS_BLOCK_DURATION. "
454
+
;;
455
+
*)
456
+
err "Container live time duration (--aws-block-duration) has wrong value: $AWS_BLOCK_DURATION. Available values of AWS spot instance duration in minutes is 60, 120, 180, 240, 300, or 360)."
457
+
exit 1
458
+
;;
459
+
esac
460
+
fi
444
461
elif [[ "$RUN_ON"=="localhost" ]];then
445
462
if [[ !-z${AWS_KEYPAIR_NAME+x} ]] || [[ !-z${AWS_SSH_KEY_PATH+x} ]] ;then
446
463
err "ERROR: options '--aws-keypair-name' and '--aws-ssh-key-path' must be used with '--run on aws'."
if [[ $output=~" Container live time duration (--aws-block-duration) has wrong value: 30. Available values of AWS spot instance duration in minutes is 60, 120, 180, 240, 300, or 360)." ]];then
0 commit comments