Skip to content
Snippets Groups Projects
Commit d7df6c9d authored by nimrod's avatar nimrod
Browse files

Some Terraform tweaks.

parent c5cef7f8
No related branches found
No related tags found
No related merge requests found
# vim: ft=bash # vim: ft=bash
complete -C terraform tf complete -C tofu tf
...@@ -10,16 +10,8 @@ alias tfp='tf init -backend=false && tf plan -out tfplan' ...@@ -10,16 +10,8 @@ alias tfp='tf init -backend=false && tf plan -out tfplan'
alias tfr='tf apply -auto-approve -refresh-only' alias tfr='tf apply -auto-approve -refresh-only'
alias tfvf='tf init -backend=false && tf validate && tf fmt -diff' alias tfvf='tf init -backend=false && tf validate && tf fmt -diff'
tfp-next () { tf-next () {
current="$(tf workspace show)" current="$(tf workspace show)"
next="$(tf workspace list | cut -c3- | grep --line-regexp --after-context=1 "$current" | tail +2)" next="$(tf workspace list | cut -c3- | grep --line-regexp --after-context=1 "$current" | tail +2)"
tf apply tfplan
tf apply -auto-approve -refresh-only
if [ -z "$next" ]
then
red "Last workspace in the cycle."
return
fi
tf workspace select "$next" tf workspace select "$next"
tf plan -out tfplan "$@"
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment