File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,14 @@ SCRIPT_PATH=$(dirname "${BASH_SOURCE[0]}")
7
7
# shellcheck source=./common.sh
8
8
source " ${SCRIPT_PATH} /common.sh"
9
9
10
+ TF_CLI_ARGS_plan=${TF_CLI_ARGS_plan:- " " }
11
+ TF_CLI_ARGS_apply=${TF_CLI_ARGS_apply:- " " }
12
+
13
+ export TF_CLI_ARGS_plan=" ${TF_CLI_ARGS_plan} -lock-timeout=5m"
14
+ export TF_CLI_ARGS_apply=" ${TF_CLI_ARGS_apply} -lock-timeout=5m"
15
+
10
16
if [ -n " ${DESTROY-} " ]; then
11
- if [ -n " ${TF_CLI_ARGS_plan-} " ] && ! grep -q " destroy" <<< " ${TF_CLI_ARGS_plan}" ; then
12
- TF_CLI_ARGS_plan=" ${TF_CLI_ARGS_plan} -destroy"
13
- else
14
- export TF_CLI_ARGS_plan=" -destroy"
15
- fi
17
+ export TF_CLI_ARGS_plan=" ${TF_CLI_ARGS_plan} -destroy"
16
18
fi
17
19
18
20
function check_workspace() {
@@ -117,7 +119,7 @@ function terraform_apply() {
117
119
check_workspace " ${WORKSPACE} "
118
120
fi
119
121
120
- terraform apply " ${plan_location} "
122
+ timeout --signal=INT --foreground 10m terraform apply " ${plan_location} "
121
123
122
124
popd || return " ${ERROR_CHANGE_DIR} "
123
125
}
You can’t perform that action at this time.
0 commit comments