From f61c5e51d8ad028f212d642ecdd6b49408db9a80 Mon Sep 17 00:00:00 2001 From: Sagi Shnaidman Date: Sun, 2 Apr 2017 17:23:33 +0300 Subject: [PATCH] Set REMAINING_TIME for local run When running CI scripts locally it fails because REMAINING_TIME is propagated by infra before the job starts. This patch sets it to some default value if it wasn't set before. Change-Id: I0050046db17e50ddd17a7115e46c4684afa87b2f --- toci_instack_oooq.sh | 1 + toci_instack_osinfra.sh | 1 + toci_instack_ovb.sh | 1 + toci_quickstart.sh | 1 + 4 files changed, 4 insertions(+) diff --git a/toci_instack_oooq.sh b/toci_instack_oooq.sh index 59c643bfa..b860b89f8 100755 --- a/toci_instack_oooq.sh +++ b/toci_instack_oooq.sh @@ -75,6 +75,7 @@ pushd $TRIPLEO_ROOT/tripleo-quickstart/ # Use $REMAINING_TIME of infra to calculate maximum time for remaning part of job # Leave 15 minutes for quickstart logs collection +REMAINING_TIME=${REMAINING_TIME:-180} TIME_FOR_DEPLOY=$(( REMAINING_TIME - ($(date +%s) - START_JOB_TIME)/60 - 15 )) /usr/bin/timeout --preserve-status ${TIME_FOR_DEPLOY}m $TRIPLEO_ROOT/tripleo-quickstart/quickstart.sh --bootstrap --no-clone \ -t all \ diff --git a/toci_instack_osinfra.sh b/toci_instack_osinfra.sh index 67544fde2..a1801fe0b 100755 --- a/toci_instack_osinfra.sh +++ b/toci_instack_osinfra.sh @@ -158,6 +158,7 @@ sudo ip link add ci-dummy type dummy # Use $REMAINING_TIME of infra to calculate maximum time for remaning part of job # Leave 10 minutes for postci function +REMAINING_TIME=${REMAINING_TIME:-180} TIME_FOR_DEPLOY=$(( REMAINING_TIME - ($(date +%s) - START_JOB_TIME)/60 - 10 )) /usr/bin/timeout --preserve-status ${TIME_FOR_DEPLOY}m $TRIPLEO_ROOT/tripleo-ci/scripts/deploy.sh if [[ $CACHEUPLOAD == 1 && can_promote ]] ; then diff --git a/toci_instack_ovb.sh b/toci_instack_ovb.sh index 0136de81e..f0d9c10dd 100755 --- a/toci_instack_ovb.sh +++ b/toci_instack_ovb.sh @@ -112,6 +112,7 @@ cp -f $TE_DATAFILE ~/instackenv.json # Use $REMAINING_TIME of infra to calculate maximum time for remaning part of job # Leave 10 minutes for postci function +REMAINING_TIME=${REMAINING_TIME:-180} TIME_FOR_DEPLOY=$(( REMAINING_TIME - ($(date +%s) - START_JOB_TIME)/60 - 10 )) /usr/bin/timeout --preserve-status ${TIME_FOR_DEPLOY}m $TRIPLEO_ROOT/tripleo-ci/scripts/deploy.sh diff --git a/toci_quickstart.sh b/toci_quickstart.sh index 4cb72a8ec..aa91c05fd 100755 --- a/toci_quickstart.sh +++ b/toci_quickstart.sh @@ -64,6 +64,7 @@ $QUICKSTART_PREPARE_CMD # Use $REMAINING_TIME of infra to calculate maximum time for remaning part of job # Leave 15 minutes for quickstart logs collection +REMAINING_TIME=${REMAINING_TIME:-180} TIME_FOR_DEPLOY=$(( REMAINING_TIME - ($(date +%s) - START_JOB_TIME)/60 - 15 )) /usr/bin/timeout --preserve-status ${TIME_FOR_DEPLOY}m $QUICKSTART_INSTALL_CMD \ 2>&1 | tee $LOGS_DIR/quickstart_install.log && exit_value=0 || exit_value=$?