Skip to content

Commit

Permalink
Merge branch 'feature/terraform-show' of https://github.com/brk3/rover
Browse files Browse the repository at this point in the history
…into brk3-feature/terraform-show
  • Loading branch information
arnaudlh authored Dec 6, 2021
2 parents b3f8010 + dfe01dc commit 56e485e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ function deploy {
"destroy")
destroy_from_remote_state
;;
"plan"|"apply"|"validate"|"refresh"|"graph"|"import"|"output"|"taint"|"untaint"|"state list"|"state rm"|"state show")
"plan"|"apply"|"validate"|"refresh"|"graph"|"import"|"output"|"taint"|"untaint"|"state list"|"state rm"|"state show"|"show")
deploy_from_remote_state
;;
*)
Expand Down
2 changes: 1 addition & 1 deletion scripts/rover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ case "${caf_command}" in
launchpad|landingzone)
if [[ ("${tf_action}" == "destroy") && (${var_folder_set} == true) && ( ! -z "${tf_plan_file}" ) ]]; then
error ${LINENO} "-var-folder or -var-file must not be set when using a plan in the destroy operation." 1
elif [[ ("${tf_action}" != "destroy") && (-z "${tf_command}") ]]; then
elif [[ ("${tf_action}" != "destroy" && "${tf_action}" != "show") && (-z "${tf_command}") ]]; then
error ${LINENO} "No parameters have been set in ${caf_command}." 1
fi
;;
Expand Down
10 changes: 6 additions & 4 deletions scripts/tfstate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -630,13 +630,15 @@ function destroy {
function other {
echo "@calling other"

echo "running terraform ${tf_action} -state="${TF_DATA_DIR}/tfstates/${TF_VAR_level}/${TF_VAR_workspace}/${TF_VAR_tf_name}" ${tf_command}"
echo "running terraform ${tf_action} ${tf_command}"

rm -f $STDERR_FILE

terraform ${tf_action} \
-state="${TF_DATA_DIR}/tfstates/${TF_VAR_level}/${TF_VAR_workspace}/${TF_VAR_tf_name}" \
${tf_command} 2>$STDERR_FILE | tee ${tf_output_file}
if [[ -z ${tf_plan_file} ]]; then
terraform ${tf_action} ${tf_command} 2>$STDERR_FILE | tee ${tf_output_file}
else
terraform ${tf_action} ${tf_command} ${tf_plan_file} 2>$STDERR_FILE | tee ${tf_output_file}
fi

RETURN_CODE=${PIPESTATUS[0]} && echo "Terraform ${tf_action} return code: ${RETURN_CODE}"

Expand Down

0 comments on commit 56e485e

Please sign in to comment.