Repository: chanzuckerberg/fogg
Pull request #307 (2019-06-25 18:44:50)

set -o pipefail
Now that we are running a few makefile targets with pipes we need to make sure we capture pipe failures.

By default make uses `/bin/sh`, so on systems where `/bin/sh` != `/bin/bash` this would also have the result of switching to bash. I think that should only be a problem for cases where bash is not installed.

### Test Plan
* ran on shared-infra repo

### References




Patch:
diff --git a/templates/repo/scripts/common.mk b/templates/repo/scripts/common.mk
index cd693702..a9e787f7 100644
--- a/templates/repo/scripts/common.mk
+++ b/templates/repo/scripts/common.mk
@@ -1,6 +1,7 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
+SHELL=/bin/bash -o pipefail
 TF_VARS := $(patsubst %,-e%,$(filter TF_VAR_%,$(.VARIABLES)))
 REPO_ROOT := $(shell git rev-parse --show-toplevel)
 REPO_RELATIVE_PATH := $(shell git rev-parse --show-prefix)


Test patch:
diff --git a/testdata/bless_provider/scripts/common.mk b/testdata/bless_provider/scripts/common.mk
index cd693702..a9e787f7 100644
--- a/testdata/bless_provider/scripts/common.mk
+++ b/testdata/bless_provider/scripts/common.mk
@@ -1,6 +1,7 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
+SHELL=/bin/bash -o pipefail
 TF_VARS := $(patsubst %,-e%,$(filter TF_VAR_%,$(.VARIABLES)))
 REPO_ROOT := $(shell git rev-parse --show-toplevel)
 REPO_RELATIVE_PATH := $(shell git rev-parse --show-prefix)
diff --git a/testdata/okta_provider/scripts/common.mk b/testdata/okta_provider/scripts/common.mk
index cd693702..a9e787f7 100644
--- a/testdata/okta_provider/scripts/common.mk
+++ b/testdata/okta_provider/scripts/common.mk
@@ -1,6 +1,7 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
+SHELL=/bin/bash -o pipefail
 TF_VARS := $(patsubst %,-e%,$(filter TF_VAR_%,$(.VARIABLES)))
 REPO_ROOT := $(shell git rev-parse --show-toplevel)
 REPO_RELATIVE_PATH := $(shell git rev-parse --show-prefix)
diff --git a/testdata/snowflake_provider/scripts/common.mk b/testdata/snowflake_provider/scripts/common.mk
index cd693702..a9e787f7 100644
--- a/testdata/snowflake_provider/scripts/common.mk
+++ b/testdata/snowflake_provider/scripts/common.mk
@@ -1,6 +1,7 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
+SHELL=/bin/bash -o pipefail
 TF_VARS := $(patsubst %,-e%,$(filter TF_VAR_%,$(.VARIABLES)))
 REPO_ROOT := $(shell git rev-parse --show-toplevel)
 REPO_RELATIVE_PATH := $(shell git rev-parse --show-prefix)
diff --git a/testdata/v1_full/scripts/common.mk b/testdata/v1_full/scripts/common.mk
index cd693702..a9e787f7 100644
--- a/testdata/v1_full/scripts/common.mk
+++ b/testdata/v1_full/scripts/common.mk
@@ -1,6 +1,7 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
+SHELL=/bin/bash -o pipefail
 TF_VARS := $(patsubst %,-e%,$(filter TF_VAR_%,$(.VARIABLES)))
 REPO_ROOT := $(shell git rev-parse --show-toplevel)
 REPO_RELATIVE_PATH := $(shell git rev-parse --show-prefix)
diff --git a/testdata/v2_full/scripts/common.mk b/testdata/v2_full/scripts/common.mk
index cd693702..a9e787f7 100644
--- a/testdata/v2_full/scripts/common.mk
+++ b/testdata/v2_full/scripts/common.mk
@@ -1,6 +1,7 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
+SHELL=/bin/bash -o pipefail
 TF_VARS := $(patsubst %,-e%,$(filter TF_VAR_%,$(.VARIABLES)))
 REPO_ROOT := $(shell git rev-parse --show-toplevel)
 REPO_RELATIVE_PATH := $(shell git rev-parse --show-prefix)
diff --git a/testdata/v2_minimal_valid/scripts/common.mk b/testdata/v2_minimal_valid/scripts/common.mk
index cd693702..a9e787f7 100644
--- a/testdata/v2_minimal_valid/scripts/common.mk
+++ b/testdata/v2_minimal_valid/scripts/common.mk
@@ -1,6 +1,7 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
+SHELL=/bin/bash -o pipefail
 TF_VARS := $(patsubst %,-e%,$(filter TF_VAR_%,$(.VARIABLES)))
 REPO_ROOT := $(shell git rev-parse --show-toplevel)
 REPO_RELATIVE_PATH := $(shell git rev-parse --show-prefix)
diff --git a/testdata/v2_no_aws_provider/scripts/common.mk b/testdata/v2_no_aws_provider/scripts/common.mk
index cd693702..a9e787f7 100644
--- a/testdata/v2_no_aws_provider/scripts/common.mk
+++ b/testdata/v2_no_aws_provider/scripts/common.mk
@@ -1,6 +1,7 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
+SHELL=/bin/bash -o pipefail
 TF_VARS := $(patsubst %,-e%,$(filter TF_VAR_%,$(.VARIABLES)))
 REPO_ROOT := $(shell git rev-parse --show-toplevel)
 REPO_RELATIVE_PATH := $(shell git rev-parse --show-prefix)