From 7b9d7dd19fbec1b4001b82a86593c259c37a764b Mon Sep 17 00:00:00 2001 From: Aaron Egaas Date: Thu, 8 Oct 2015 13:34:45 -0700 Subject: [PATCH 1/6] dynamically pick the environment based on whether a tag is used --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 19a628b..996ada1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,8 @@ before_script: script: - npm test - bower install -- roots compile -e staging +- if [$TRAVIS_TAG -ne ""]; then $env='production'; else $env='staging'; fi; +- roots compile -e $env node_js: - '0.12' sudo: false From 86e92d14d3b9b20b7ee49d5e67c34af7a5b1e867 Mon Sep 17 00:00:00 2001 From: Aaron Egaas Date: Thu, 8 Oct 2015 13:38:56 -0700 Subject: [PATCH 2/6] need to export the vars --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 996ada1..75f269a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ before_script: script: - npm test - bower install -- if [$TRAVIS_TAG -ne ""]; then $env='production'; else $env='staging'; fi; +- if [$TRAVIS_TAG -ne ""]; then export env='production'; else export env='staging'; fi; - roots compile -e $env node_js: - '0.12' From de1702ad04a736029964cdabfcc0e4117beed8ac Mon Sep 17 00:00:00 2001 From: Aaron Egaas Date: Thu, 8 Oct 2015 13:42:01 -0700 Subject: [PATCH 3/6] addn an echo to help CI verify this is working --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 75f269a..0d953aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ before_script: script: - npm test - bower install -- if [$TRAVIS_TAG -ne ""]; then export env='production'; else export env='staging'; fi; +- if [$TRAVIS_TAG -ne ""]; then export env='production'; else export env='staging'; fi; echo $env; - roots compile -e $env node_js: - '0.12' From e979194bcb4fc87a35fd616b299a29f8b42385ef Mon Sep 17 00:00:00 2001 From: Aaron Egaas Date: Thu, 8 Oct 2015 13:47:00 -0700 Subject: [PATCH 4/6] what is TRAVIS_TAG --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0d953aa..f89032b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ before_script: script: - npm test - bower install -- if [$TRAVIS_TAG -ne ""]; then export env='production'; else export env='staging'; fi; echo $env; +- echo $TRAVIS_TAG; if [$TRAVIS_TAG -ne ""]; then export env='production'; else export env='staging'; fi; echo $env; - roots compile -e $env node_js: - '0.12' From 815d791a76d51804c79b1e86bbcd3afe7637c856 Mon Sep 17 00:00:00 2001 From: Aaron Egaas Date: Thu, 8 Oct 2015 13:50:47 -0700 Subject: [PATCH 5/6] use -n and quote the var in the if --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f89032b..c222124 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ before_script: script: - npm test - bower install -- echo $TRAVIS_TAG; if [$TRAVIS_TAG -ne ""]; then export env='production'; else export env='staging'; fi; echo $env; +- echo $TRAVIS_TAG; if [ -n "$TRAVIS_TAG"]; then export env='production'; else export env='staging'; fi; echo $env; - roots compile -e $env node_js: - '0.12' From b47aa06508890adda84a4460cad42942c7e1401d Mon Sep 17 00:00:00 2001 From: Aaron Egaas Date: Thu, 8 Oct 2015 13:54:56 -0700 Subject: [PATCH 6/6] basic string comparison --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c222124..be3a89a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ before_script: script: - npm test - bower install -- echo $TRAVIS_TAG; if [ -n "$TRAVIS_TAG"]; then export env='production'; else export env='staging'; fi; echo $env; +- echo $TRAVIS_TAG; if [ "$TRAVIS_TAG" != "" ]; then export env='production'; else export env='staging'; fi; echo $env; - roots compile -e $env node_js: - '0.12'