Repository: chanzuckerberg/fogg
Pull request #353 (2019-08-21 01:56:01)

make setup instead of inline download.sh in .travis.yml
Fixes issues with git status --porcelain check.

codecov[bot]: # [Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/353?src=pr&el=h1) Report
> Merging [#353](https://codecov.io/gh/chanzuckerberg/fogg/pull/353?src=pr&el=desc) into [master](https://codecov.io/gh/chanzuckerberg/fogg/commit/3e628105745de44159207d3db8eabeac5615ca58?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/353/graphs/tree.svg?width=650&token=57DhtZ7g2A&height=150&src=pr)](https://codecov.io/gh/chanzuckerberg/fogg/pull/353?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master     #353   +/-   ##
=======================================
  Coverage   77.74%   77.74%           
=======================================
  Files          25       25           
  Lines        1896     1896           
=======================================
  Hits         1474     1474           
  Misses        285      285           
  Partials      137      137
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/353?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/353?src=pr&el=footer). Last update [3e62810...7c979ca](https://codecov.io/gh/chanzuckerberg/fogg/pull/353?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

mbarrien: Changes made... is .fogg/bin in the path?
mbarrien: Added support to make setup to pass in a fogg version via FOGG_VERSION environment variable. Please re-review.

Alternatively, we could make it read .fogg_version file instead.

Patch:
diff --git a/templates/repo/Makefile.tmpl b/templates/repo/Makefile.tmpl
index 96d6014d..c5866741 100644
--- a/templates/repo/Makefile.tmpl
+++ b/templates/repo/Makefile.tmpl
@@ -10,7 +10,7 @@ ACCOUNTS={{ .Accounts | dict | keys | sortAlpha | join " "}}
 all: check
 
 setup:
-	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin
+	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin $(FOGG_VERSION)
 	fogg setup
 .PHONY: setup
 
diff --git a/templates/travis-ci/.travis.yml.tmpl b/templates/travis-ci/.travis.yml.tmpl
index 20aab840..d7feac11 100644
--- a/templates/travis-ci/.travis.yml.tmpl
+++ b/templates/travis-ci/.travis.yml.tmpl
@@ -7,9 +7,7 @@ python: 3.6
 install:
   - pip install awscli --upgrade
   - aws --version
-  - curl -o download.sh -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh
-  - travis_retry bash download.sh -b $HOME/bin v{{ .FoggVersion }}
-  - travis_retry fogg setup
+  - FOGG_VERSION="v{{ .FoggVersion }}" travis_retry make setup
 before_script:
   # TODO add note about why these need to be prefixed with HUB_
   - aws configure set aws_access_key_id     $IDACCT_AWS_ACCESS_KEY_ID     --profile _idacct


Test patch:
diff --git a/testdata/bless_provider/Makefile b/testdata/bless_provider/Makefile
index 292dd091..70511f04 100644
--- a/testdata/bless_provider/Makefile
+++ b/testdata/bless_provider/Makefile
@@ -10,7 +10,7 @@ ACCOUNTS=foo
 all: check
 
 setup:
-	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin
+	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin $(FOGG_VERSION)
 	fogg setup
 .PHONY: setup
 
diff --git a/testdata/github_provider/Makefile b/testdata/github_provider/Makefile
index 292dd091..70511f04 100644
--- a/testdata/github_provider/Makefile
+++ b/testdata/github_provider/Makefile
@@ -10,7 +10,7 @@ ACCOUNTS=foo
 all: check
 
 setup:
-	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin
+	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin $(FOGG_VERSION)
 	fogg setup
 .PHONY: setup
 
diff --git a/testdata/okta_provider/Makefile b/testdata/okta_provider/Makefile
index 292dd091..70511f04 100644
--- a/testdata/okta_provider/Makefile
+++ b/testdata/okta_provider/Makefile
@@ -10,7 +10,7 @@ ACCOUNTS=foo
 all: check
 
 setup:
-	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin
+	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin $(FOGG_VERSION)
 	fogg setup
 .PHONY: setup
 
diff --git a/testdata/snowflake_provider/Makefile b/testdata/snowflake_provider/Makefile
index 292dd091..70511f04 100644
--- a/testdata/snowflake_provider/Makefile
+++ b/testdata/snowflake_provider/Makefile
@@ -10,7 +10,7 @@ ACCOUNTS=foo
 all: check
 
 setup:
-	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin
+	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin $(FOGG_VERSION)
 	fogg setup
 .PHONY: setup
 
diff --git a/testdata/v1_full/.travis.yml b/testdata/v1_full/.travis.yml
index 70594701..c10865d1 100644
--- a/testdata/v1_full/.travis.yml
+++ b/testdata/v1_full/.travis.yml
@@ -7,9 +7,7 @@ python: 3.6
 install:
   - pip install awscli --upgrade
   - aws --version
-  - curl -o download.sh -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh
-  - travis_retry bash download.sh -b $HOME/bin vundefined+undefined+dirty
-  - travis_retry fogg setup
+  - FOGG_VERSION="vundefined+undefined+dirty" travis_retry make setup
 before_script:
   # TODO add note about why these need to be prefixed with HUB_
   - aws configure set aws_access_key_id     $IDACCT_AWS_ACCESS_KEY_ID     --profile _idacct
diff --git a/testdata/v1_full/Makefile b/testdata/v1_full/Makefile
index bb08749a..999355d5 100644
--- a/testdata/v1_full/Makefile
+++ b/testdata/v1_full/Makefile
@@ -10,7 +10,7 @@ ACCOUNTS=bar foo
 all: check
 
 setup:
-	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin
+	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin $(FOGG_VERSION)
 	fogg setup
 .PHONY: setup
 
diff --git a/testdata/v2_full/Makefile b/testdata/v2_full/Makefile
index fad49870..5fb9c053 100644
--- a/testdata/v2_full/Makefile
+++ b/testdata/v2_full/Makefile
@@ -10,7 +10,7 @@ ACCOUNTS=bar foo
 all: check
 
 setup:
-	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin
+	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin $(FOGG_VERSION)
 	fogg setup
 .PHONY: setup
 
diff --git a/testdata/v2_minimal_valid/Makefile b/testdata/v2_minimal_valid/Makefile
index e8438c98..269ceca3 100644
--- a/testdata/v2_minimal_valid/Makefile
+++ b/testdata/v2_minimal_valid/Makefile
@@ -10,7 +10,7 @@ ACCOUNTS=
 all: check
 
 setup:
-	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin
+	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin $(FOGG_VERSION)
 	fogg setup
 .PHONY: setup
 
diff --git a/testdata/v2_no_aws_provider/Makefile b/testdata/v2_no_aws_provider/Makefile
index fad49870..5fb9c053 100644
--- a/testdata/v2_no_aws_provider/Makefile
+++ b/testdata/v2_no_aws_provider/Makefile
@@ -10,7 +10,7 @@ ACCOUNTS=bar foo
 all: check
 
 setup:
-	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin
+	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin $(FOGG_VERSION)
 	fogg setup
 .PHONY: setup
 
diff --git a/testdata/version_detection/Makefile b/testdata/version_detection/Makefile
index 1347b8d4..09eae0a2 100644
--- a/testdata/version_detection/Makefile
+++ b/testdata/version_detection/Makefile
@@ -10,7 +10,7 @@ ACCOUNTS=
 all: check
 
 setup:
-	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin
+	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin $(FOGG_VERSION)
 	fogg setup
 .PHONY: setup