Repository: chanzuckerberg/fogg
Pull request #301 (2019-06-19 17:47:50)

[bug] fix makefiles for post-docker support
When docker support was removed, we missed a few things.

### Test Plan
* unit tests, applied to shared-infra repo

### References



codecov[bot]: # [Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/301?src=pr&el=h1) Report
> Merging [#301](https://codecov.io/gh/chanzuckerberg/fogg/pull/301?src=pr&el=desc) into [master](https://codecov.io/gh/chanzuckerberg/fogg/commit/5c5f24c33520d84656c533d707730b9a95e15fa0?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/chanzuckerberg/fogg/pull/301/graphs/tree.svg?width=650&token=57DhtZ7g2A&height=150&src=pr)](https://codecov.io/gh/chanzuckerberg/fogg/pull/301?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master     #301   +/-   ##
=======================================
  Coverage   80.55%   80.55%           
=======================================
  Files          17       17           
  Lines        1466     1466           
=======================================
  Hits         1181     1181           
  Misses        163      163           
  Partials      122      122
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/301?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/301?src=pr&el=footer). Last update [5c5f24c...abf5abb](https://codecov.io/gh/chanzuckerberg/fogg/pull/301?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/templates/repo/scripts/component.mk b/templates/repo/scripts/component.mk
index 594636c5..070f9009 100644
--- a/templates/repo/scripts/component.mk
+++ b/templates/repo/scripts/component.mk
@@ -6,48 +6,62 @@ SELF_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
 include $(SELF_DIR)/common.mk
 
 all:
+.PHONY: all
 
 check: lint check-plan
+.PHONY: check
 
 fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt $$f; done'; \
 	echo
+.PHONY: fmt
 
 lint: terraform-validate lint-terraform-fmt lint-tflint
+.PHONY: lint
 
 lint-tflint: init
 	if (( $$TFLINT_ENABLED )); then \
     $(sh_command) -c 'tflint' || exit $$?; \
-	fi \
+	fi
+.PHONY: lint-tflint
 
 terraform-validate: terraform init
 	$(sh_command) -c 'terraform validate -check-variables=true'
+.PHONY: terraform-validate
 
 lint-terraform-fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt --check=true --diff=true $$f || exit $$? ; done'
+.PHONY: lint-terraform-fmt
 
-get: ssh-forward terraform
+get: terraform
 	$(terraform_command) get --update=true
+.PHONY: get
 
-plan: terraform fmt get init ssh-forward
+plan: terraform fmt get init
 	$(terraform_command) plan
+.PHONY: plan
 
-apply: terraform fmt get init ssh-forward
+apply: terraform fmt get init
 	$(terraform_command) apply -auto-approve=$(AUTO_APPROVE)
+.PHONY: apply
 
 docs:
 	echo
+.PHONY: docs
 
 clean:
 	-rm -rfv .terraform/modules
 	-rm -rfv .terraform/plugins
+.PHONY: clean
 
 test:
+.PHONY: test
 
-init: terraform ssh-forward
+init: terraform
 	$(terraform_command) init -input=false
+.PHONY: init
 
-check-plan: terraform init get ssh-forward
+check-plan: terraform init get
 	$(terraform_command) plan -detailed-exitcode; \
 	ERR=$$?; \
 	if [ $$ERR -eq 0 ] ; then \
@@ -58,8 +72,8 @@ check-plan: terraform init get ssh-forward
 	elif [ $$ERR -eq 2 ] ; then \
 		echo "Diff";  \
 	fi
+.PHONY: check-plan
 
 run:
 	$(terraform_command) $(CMD)
-
-.PHONY: all apply clean docs fmt get lint plan run ssh-forward test
+.PHONY: run


Test patch:
diff --git a/testdata/bless_provider/scripts/component.mk b/testdata/bless_provider/scripts/component.mk
index 594636c5..070f9009 100644
--- a/testdata/bless_provider/scripts/component.mk
+++ b/testdata/bless_provider/scripts/component.mk
@@ -6,48 +6,62 @@ SELF_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
 include $(SELF_DIR)/common.mk
 
 all:
+.PHONY: all
 
 check: lint check-plan
+.PHONY: check
 
 fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt $$f; done'; \
 	echo
+.PHONY: fmt
 
 lint: terraform-validate lint-terraform-fmt lint-tflint
+.PHONY: lint
 
 lint-tflint: init
 	if (( $$TFLINT_ENABLED )); then \
     $(sh_command) -c 'tflint' || exit $$?; \
-	fi \
+	fi
+.PHONY: lint-tflint
 
 terraform-validate: terraform init
 	$(sh_command) -c 'terraform validate -check-variables=true'
+.PHONY: terraform-validate
 
 lint-terraform-fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt --check=true --diff=true $$f || exit $$? ; done'
+.PHONY: lint-terraform-fmt
 
-get: ssh-forward terraform
+get: terraform
 	$(terraform_command) get --update=true
+.PHONY: get
 
-plan: terraform fmt get init ssh-forward
+plan: terraform fmt get init
 	$(terraform_command) plan
+.PHONY: plan
 
-apply: terraform fmt get init ssh-forward
+apply: terraform fmt get init
 	$(terraform_command) apply -auto-approve=$(AUTO_APPROVE)
+.PHONY: apply
 
 docs:
 	echo
+.PHONY: docs
 
 clean:
 	-rm -rfv .terraform/modules
 	-rm -rfv .terraform/plugins
+.PHONY: clean
 
 test:
+.PHONY: test
 
-init: terraform ssh-forward
+init: terraform
 	$(terraform_command) init -input=false
+.PHONY: init
 
-check-plan: terraform init get ssh-forward
+check-plan: terraform init get
 	$(terraform_command) plan -detailed-exitcode; \
 	ERR=$$?; \
 	if [ $$ERR -eq 0 ] ; then \
@@ -58,8 +72,8 @@ check-plan: terraform init get ssh-forward
 	elif [ $$ERR -eq 2 ] ; then \
 		echo "Diff";  \
 	fi
+.PHONY: check-plan
 
 run:
 	$(terraform_command) $(CMD)
-
-.PHONY: all apply clean docs fmt get lint plan run ssh-forward test
+.PHONY: run
diff --git a/testdata/okta_provider/scripts/component.mk b/testdata/okta_provider/scripts/component.mk
index 594636c5..070f9009 100644
--- a/testdata/okta_provider/scripts/component.mk
+++ b/testdata/okta_provider/scripts/component.mk
@@ -6,48 +6,62 @@ SELF_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
 include $(SELF_DIR)/common.mk
 
 all:
+.PHONY: all
 
 check: lint check-plan
+.PHONY: check
 
 fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt $$f; done'; \
 	echo
+.PHONY: fmt
 
 lint: terraform-validate lint-terraform-fmt lint-tflint
+.PHONY: lint
 
 lint-tflint: init
 	if (( $$TFLINT_ENABLED )); then \
     $(sh_command) -c 'tflint' || exit $$?; \
-	fi \
+	fi
+.PHONY: lint-tflint
 
 terraform-validate: terraform init
 	$(sh_command) -c 'terraform validate -check-variables=true'
+.PHONY: terraform-validate
 
 lint-terraform-fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt --check=true --diff=true $$f || exit $$? ; done'
+.PHONY: lint-terraform-fmt
 
-get: ssh-forward terraform
+get: terraform
 	$(terraform_command) get --update=true
+.PHONY: get
 
-plan: terraform fmt get init ssh-forward
+plan: terraform fmt get init
 	$(terraform_command) plan
+.PHONY: plan
 
-apply: terraform fmt get init ssh-forward
+apply: terraform fmt get init
 	$(terraform_command) apply -auto-approve=$(AUTO_APPROVE)
+.PHONY: apply
 
 docs:
 	echo
+.PHONY: docs
 
 clean:
 	-rm -rfv .terraform/modules
 	-rm -rfv .terraform/plugins
+.PHONY: clean
 
 test:
+.PHONY: test
 
-init: terraform ssh-forward
+init: terraform
 	$(terraform_command) init -input=false
+.PHONY: init
 
-check-plan: terraform init get ssh-forward
+check-plan: terraform init get
 	$(terraform_command) plan -detailed-exitcode; \
 	ERR=$$?; \
 	if [ $$ERR -eq 0 ] ; then \
@@ -58,8 +72,8 @@ check-plan: terraform init get ssh-forward
 	elif [ $$ERR -eq 2 ] ; then \
 		echo "Diff";  \
 	fi
+.PHONY: check-plan
 
 run:
 	$(terraform_command) $(CMD)
-
-.PHONY: all apply clean docs fmt get lint plan run ssh-forward test
+.PHONY: run
diff --git a/testdata/snowflake_provider/scripts/component.mk b/testdata/snowflake_provider/scripts/component.mk
index 594636c5..070f9009 100644
--- a/testdata/snowflake_provider/scripts/component.mk
+++ b/testdata/snowflake_provider/scripts/component.mk
@@ -6,48 +6,62 @@ SELF_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
 include $(SELF_DIR)/common.mk
 
 all:
+.PHONY: all
 
 check: lint check-plan
+.PHONY: check
 
 fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt $$f; done'; \
 	echo
+.PHONY: fmt
 
 lint: terraform-validate lint-terraform-fmt lint-tflint
+.PHONY: lint
 
 lint-tflint: init
 	if (( $$TFLINT_ENABLED )); then \
     $(sh_command) -c 'tflint' || exit $$?; \
-	fi \
+	fi
+.PHONY: lint-tflint
 
 terraform-validate: terraform init
 	$(sh_command) -c 'terraform validate -check-variables=true'
+.PHONY: terraform-validate
 
 lint-terraform-fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt --check=true --diff=true $$f || exit $$? ; done'
+.PHONY: lint-terraform-fmt
 
-get: ssh-forward terraform
+get: terraform
 	$(terraform_command) get --update=true
+.PHONY: get
 
-plan: terraform fmt get init ssh-forward
+plan: terraform fmt get init
 	$(terraform_command) plan
+.PHONY: plan
 
-apply: terraform fmt get init ssh-forward
+apply: terraform fmt get init
 	$(terraform_command) apply -auto-approve=$(AUTO_APPROVE)
+.PHONY: apply
 
 docs:
 	echo
+.PHONY: docs
 
 clean:
 	-rm -rfv .terraform/modules
 	-rm -rfv .terraform/plugins
+.PHONY: clean
 
 test:
+.PHONY: test
 
-init: terraform ssh-forward
+init: terraform
 	$(terraform_command) init -input=false
+.PHONY: init
 
-check-plan: terraform init get ssh-forward
+check-plan: terraform init get
 	$(terraform_command) plan -detailed-exitcode; \
 	ERR=$$?; \
 	if [ $$ERR -eq 0 ] ; then \
@@ -58,8 +72,8 @@ check-plan: terraform init get ssh-forward
 	elif [ $$ERR -eq 2 ] ; then \
 		echo "Diff";  \
 	fi
+.PHONY: check-plan
 
 run:
 	$(terraform_command) $(CMD)
-
-.PHONY: all apply clean docs fmt get lint plan run ssh-forward test
+.PHONY: run
diff --git a/testdata/v1_full/scripts/component.mk b/testdata/v1_full/scripts/component.mk
index 594636c5..070f9009 100644
--- a/testdata/v1_full/scripts/component.mk
+++ b/testdata/v1_full/scripts/component.mk
@@ -6,48 +6,62 @@ SELF_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
 include $(SELF_DIR)/common.mk
 
 all:
+.PHONY: all
 
 check: lint check-plan
+.PHONY: check
 
 fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt $$f; done'; \
 	echo
+.PHONY: fmt
 
 lint: terraform-validate lint-terraform-fmt lint-tflint
+.PHONY: lint
 
 lint-tflint: init
 	if (( $$TFLINT_ENABLED )); then \
     $(sh_command) -c 'tflint' || exit $$?; \
-	fi \
+	fi
+.PHONY: lint-tflint
 
 terraform-validate: terraform init
 	$(sh_command) -c 'terraform validate -check-variables=true'
+.PHONY: terraform-validate
 
 lint-terraform-fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt --check=true --diff=true $$f || exit $$? ; done'
+.PHONY: lint-terraform-fmt
 
-get: ssh-forward terraform
+get: terraform
 	$(terraform_command) get --update=true
+.PHONY: get
 
-plan: terraform fmt get init ssh-forward
+plan: terraform fmt get init
 	$(terraform_command) plan
+.PHONY: plan
 
-apply: terraform fmt get init ssh-forward
+apply: terraform fmt get init
 	$(terraform_command) apply -auto-approve=$(AUTO_APPROVE)
+.PHONY: apply
 
 docs:
 	echo
+.PHONY: docs
 
 clean:
 	-rm -rfv .terraform/modules
 	-rm -rfv .terraform/plugins
+.PHONY: clean
 
 test:
+.PHONY: test
 
-init: terraform ssh-forward
+init: terraform
 	$(terraform_command) init -input=false
+.PHONY: init
 
-check-plan: terraform init get ssh-forward
+check-plan: terraform init get
 	$(terraform_command) plan -detailed-exitcode; \
 	ERR=$$?; \
 	if [ $$ERR -eq 0 ] ; then \
@@ -58,8 +72,8 @@ check-plan: terraform init get ssh-forward
 	elif [ $$ERR -eq 2 ] ; then \
 		echo "Diff";  \
 	fi
+.PHONY: check-plan
 
 run:
 	$(terraform_command) $(CMD)
-
-.PHONY: all apply clean docs fmt get lint plan run ssh-forward test
+.PHONY: run
diff --git a/testdata/v2_full/scripts/component.mk b/testdata/v2_full/scripts/component.mk
index 594636c5..070f9009 100644
--- a/testdata/v2_full/scripts/component.mk
+++ b/testdata/v2_full/scripts/component.mk
@@ -6,48 +6,62 @@ SELF_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
 include $(SELF_DIR)/common.mk
 
 all:
+.PHONY: all
 
 check: lint check-plan
+.PHONY: check
 
 fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt $$f; done'; \
 	echo
+.PHONY: fmt
 
 lint: terraform-validate lint-terraform-fmt lint-tflint
+.PHONY: lint
 
 lint-tflint: init
 	if (( $$TFLINT_ENABLED )); then \
     $(sh_command) -c 'tflint' || exit $$?; \
-	fi \
+	fi
+.PHONY: lint-tflint
 
 terraform-validate: terraform init
 	$(sh_command) -c 'terraform validate -check-variables=true'
+.PHONY: terraform-validate
 
 lint-terraform-fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt --check=true --diff=true $$f || exit $$? ; done'
+.PHONY: lint-terraform-fmt
 
-get: ssh-forward terraform
+get: terraform
 	$(terraform_command) get --update=true
+.PHONY: get
 
-plan: terraform fmt get init ssh-forward
+plan: terraform fmt get init
 	$(terraform_command) plan
+.PHONY: plan
 
-apply: terraform fmt get init ssh-forward
+apply: terraform fmt get init
 	$(terraform_command) apply -auto-approve=$(AUTO_APPROVE)
+.PHONY: apply
 
 docs:
 	echo
+.PHONY: docs
 
 clean:
 	-rm -rfv .terraform/modules
 	-rm -rfv .terraform/plugins
+.PHONY: clean
 
 test:
+.PHONY: test
 
-init: terraform ssh-forward
+init: terraform
 	$(terraform_command) init -input=false
+.PHONY: init
 
-check-plan: terraform init get ssh-forward
+check-plan: terraform init get
 	$(terraform_command) plan -detailed-exitcode; \
 	ERR=$$?; \
 	if [ $$ERR -eq 0 ] ; then \
@@ -58,8 +72,8 @@ check-plan: terraform init get ssh-forward
 	elif [ $$ERR -eq 2 ] ; then \
 		echo "Diff";  \
 	fi
+.PHONY: check-plan
 
 run:
 	$(terraform_command) $(CMD)
-
-.PHONY: all apply clean docs fmt get lint plan run ssh-forward test
+.PHONY: run
diff --git a/testdata/v2_minimal_valid/scripts/component.mk b/testdata/v2_minimal_valid/scripts/component.mk
index 594636c5..070f9009 100644
--- a/testdata/v2_minimal_valid/scripts/component.mk
+++ b/testdata/v2_minimal_valid/scripts/component.mk
@@ -6,48 +6,62 @@ SELF_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
 include $(SELF_DIR)/common.mk
 
 all:
+.PHONY: all
 
 check: lint check-plan
+.PHONY: check
 
 fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt $$f; done'; \
 	echo
+.PHONY: fmt
 
 lint: terraform-validate lint-terraform-fmt lint-tflint
+.PHONY: lint
 
 lint-tflint: init
 	if (( $$TFLINT_ENABLED )); then \
     $(sh_command) -c 'tflint' || exit $$?; \
-	fi \
+	fi
+.PHONY: lint-tflint
 
 terraform-validate: terraform init
 	$(sh_command) -c 'terraform validate -check-variables=true'
+.PHONY: terraform-validate
 
 lint-terraform-fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt --check=true --diff=true $$f || exit $$? ; done'
+.PHONY: lint-terraform-fmt
 
-get: ssh-forward terraform
+get: terraform
 	$(terraform_command) get --update=true
+.PHONY: get
 
-plan: terraform fmt get init ssh-forward
+plan: terraform fmt get init
 	$(terraform_command) plan
+.PHONY: plan
 
-apply: terraform fmt get init ssh-forward
+apply: terraform fmt get init
 	$(terraform_command) apply -auto-approve=$(AUTO_APPROVE)
+.PHONY: apply
 
 docs:
 	echo
+.PHONY: docs
 
 clean:
 	-rm -rfv .terraform/modules
 	-rm -rfv .terraform/plugins
+.PHONY: clean
 
 test:
+.PHONY: test
 
-init: terraform ssh-forward
+init: terraform
 	$(terraform_command) init -input=false
+.PHONY: init
 
-check-plan: terraform init get ssh-forward
+check-plan: terraform init get
 	$(terraform_command) plan -detailed-exitcode; \
 	ERR=$$?; \
 	if [ $$ERR -eq 0 ] ; then \
@@ -58,8 +72,8 @@ check-plan: terraform init get ssh-forward
 	elif [ $$ERR -eq 2 ] ; then \
 		echo "Diff";  \
 	fi
+.PHONY: check-plan
 
 run:
 	$(terraform_command) $(CMD)
-
-.PHONY: all apply clean docs fmt get lint plan run ssh-forward test
+.PHONY: run
diff --git a/testdata/v2_no_aws_provider/scripts/component.mk b/testdata/v2_no_aws_provider/scripts/component.mk
index 594636c5..070f9009 100644
--- a/testdata/v2_no_aws_provider/scripts/component.mk
+++ b/testdata/v2_no_aws_provider/scripts/component.mk
@@ -6,48 +6,62 @@ SELF_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
 include $(SELF_DIR)/common.mk
 
 all:
+.PHONY: all
 
 check: lint check-plan
+.PHONY: check
 
 fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt $$f; done'; \
 	echo
+.PHONY: fmt
 
 lint: terraform-validate lint-terraform-fmt lint-tflint
+.PHONY: lint
 
 lint-tflint: init
 	if (( $$TFLINT_ENABLED )); then \
     $(sh_command) -c 'tflint' || exit $$?; \
-	fi \
+	fi
+.PHONY: lint-tflint
 
 terraform-validate: terraform init
 	$(sh_command) -c 'terraform validate -check-variables=true'
+.PHONY: terraform-validate
 
 lint-terraform-fmt: terraform
 	$(sh_command) -c 'for f in $(TF); do printf .; terraform fmt --check=true --diff=true $$f || exit $$? ; done'
+.PHONY: lint-terraform-fmt
 
-get: ssh-forward terraform
+get: terraform
 	$(terraform_command) get --update=true
+.PHONY: get
 
-plan: terraform fmt get init ssh-forward
+plan: terraform fmt get init
 	$(terraform_command) plan
+.PHONY: plan
 
-apply: terraform fmt get init ssh-forward
+apply: terraform fmt get init
 	$(terraform_command) apply -auto-approve=$(AUTO_APPROVE)
+.PHONY: apply
 
 docs:
 	echo
+.PHONY: docs
 
 clean:
 	-rm -rfv .terraform/modules
 	-rm -rfv .terraform/plugins
+.PHONY: clean
 
 test:
+.PHONY: test
 
-init: terraform ssh-forward
+init: terraform
 	$(terraform_command) init -input=false
+.PHONY: init
 
-check-plan: terraform init get ssh-forward
+check-plan: terraform init get
 	$(terraform_command) plan -detailed-exitcode; \
 	ERR=$$?; \
 	if [ $$ERR -eq 0 ] ; then \
@@ -58,8 +72,8 @@ check-plan: terraform init get ssh-forward
 	elif [ $$ERR -eq 2 ] ; then \
 		echo "Diff";  \
 	fi
+.PHONY: check-plan
 
 run:
 	$(terraform_command) $(CMD)
-
-.PHONY: all apply clean docs fmt get lint plan run ssh-forward test
+.PHONY: run