File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1+ ## 1.1.3 (12/04/2017)
2+
3+ * Support the use of .terraform-version file in components when in the presence of [ tfenv] ( https://github.com/kamatama41/tfenv )
4+
15## 1.1.2 (06/04/2017)
26
37 * Provide a case for import that requires the variable file parameters
Original file line number Diff line number Diff line change 88# #
99# Set Script Version
1010# #
11- readonly script_ver=" 1.1.2 " ;
11+ readonly script_ver=" 1.1.3 " ;
1212
1313# #
1414# Standardised failure function
@@ -289,9 +289,16 @@ rm -rf ${component_path}/.terraform/terraform.tfstate*;
289289
290290# Make sure we're running in the component directory
291291cd " ${component_path} " ;
292-
293292readonly component_name=$( basename ${component_path} ) ;
294293
294+ # Check for presence of tfenv (https://github.com/kamatama41/tfenv)
295+ # and a .terraform-version file. If both present, ensure required
296+ # version of terraform for this component is installed automagically.
297+ tfenv_bin=" $( which tfenv 2> /dev/null) " ;
298+ if [[ -n " ${tfenv_bin} " && -x " ${tfenv_bin} " && -f .terraform-version ]]; then
299+ ${tfenv_bin} install;
300+ fi ;
301+
295302if [ -f " pre_apply.sh" ]; then
296303 bash pre_apply.sh " ${region} " " ${environment} " " ${action} " ;
297304 (( status= status+ "$? ")) ;
You can’t perform that action at this time.
0 commit comments