imfreedom/bamboo-terraform
Clone
Summary
Browse
Changes
Graph
set bamboo capabilities to an empty dict by default
draft
default
tip
2019-10-01, Gary Kramlich
05b5b1440935
set bamboo capabilities to an empty dict by default
NODE
=
PLAN_LIMIT
=
$(
LIMIT:%
=
-target
=
%
)
TFARGS
=
-var-file
nodes/
$(
NODE
)
.tfvars
PARALLELISM
:=
4
all
:
plan
plan
:
_require_node
_state
terraform
plan
-parallelism
=
$(
PARALLELISM
)
-out
$(
NODE
)
.tfplan
$(
TFARGS
)
$(
PLAN_LIMIT
)
showplan
:
_require_node
_state
terraform
showplan
$(
NODE
)
.tfplan
destroy
:
_require_node
_state
terraform
plan
-destroy
-out
$(
NODE
)
.tfplan
$(
TFARGS
)
apply
:
_require_node
_state
terraform
apply
-input
=
true
$(
NODE
)
.tfplan
rm
$(
NODE
)
.tfplan
refresh
:
_require_node
_state
terraform
refresh
$(
TFARGS
)
clean
:
rm
-f
*.tfplan*
rm
-f
*.tfstate*
_require_node
:
nodes
/
$(
NODE
)
.
tfvars
$(
warning
*
)
$(
warning
*
)
$(
warning
Executing
on
host
$(
NODE
))
$(
warning
*
)
$(
warning
*
)
_state
:
_require_node
ifneq ("$(wildcard .terraform/terraform.tfstate)","")
rm
.terraform/terraform.tfstate
endif
terraform
init
--backend-config
=
"key=
$(
NODE
)
.tfstate"
nodes/$(NODE).tfvars
:
@echo
unknown
node
\"
$(
NODE
)
\"
@exit
1