Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

Feature: builder envs TASK ENV_VAR2=foo ENV_VAR2=bar #29

Closed
ryan-roemer opened this issue Nov 24, 2015 · 3 comments
Closed

Feature: builder envs TASK ENV_VAR2=foo ENV_VAR2=bar #29

ryan-roemer opened this issue Nov 24, 2015 · 3 comments

Comments

@ryan-roemer
Copy link
Member

Instead of concurrently running lots of npm scripts tasks, instead split concurrent processes on a list of environmental variables to be parsed and passed in to exec environment in an OS-agnostic way.

Use case: Selenium tests and ROWDY_SETTINGS

$ builder envs test-func \
  ROWDY_SETTINGS="local.phantomjs" \
  ROWDY_SETTINGS="local.firefox" \
  ROWDY_SETTINGS="sauceLabs.chrome_43_Windows_2012_R2_Desktop" \
  ROWDY_SETTINGS="sauceLabs.firefox_38_Windows_2012_R2_Desktop" \
  ROWDY_SETTINGS="sauceLabs.IE_9_Windows_2008_Desktop" \
  ROWDY_SETTINGS="sauceLabs.IE_10_Windows_2012_Desktop" \
  ROWDY_SETTINGS="sauceLabs.IE_11_Windows_2012_R2_Desktop"

OR

$ builder envs test-func \
  '[ { "ROWDY_SETTINGS":"sauceLabs.IE_8_Windows_2008_Desktop" }, \
     { "ROWDY_SETTINGS":"sauceLabs.IE_9_Windows_2008_Desktop" }, \
     { "ROWDY_SETTINGS":"sauceLabs.IE_10_Windows_2012_Desktop" }, \
     { "ROWDY_SETTINGS":"sauceLabs.safari_7_OS_X_10_9_Desktop" }, \
     { "ROWDY_SETTINGS":"sauceLabs.safari_8_OS_X_10_10_Desktop" }, \
     { "ROWDY_SETTINGS":"sauceLabs.chrome_43_OS_X_10_10_Desktop" }, \
     { "ROWDY_SETTINGS":"sauceLabs.chrome_43_Windows_2012_R2_Desktop" }, \
     { "ROWDY_SETTINGS":"sauceLabs.firefox_9_Windows_2012_R2_Desktop" }, \
     { "ROWDY_SETTINGS":"local.firefox" } ]'

Probably leaning toward the latter (JSON string) as:

  • Easier to parse command-line wise.
  • Can have a multiple environment variables for "one" environment.
  • Solves the "no variable" problem. (e.g., do {})

Current strawman:

$ builder envs \
  --tries=3 \
  --queue=3 \
  --envs-path=FILE_PATH \
  TASK \
  JSON_STRING
@ryan-roemer ryan-roemer changed the title Feature: builder concurrent-env TASK ENV_VAR2=foo ENV_VAR2=bar Feature: builder envs TASK ENV_VAR2=foo ENV_VAR2=bar Dec 5, 2015
@curiouslychase
Copy link

I think since we're working with Javascript and npm tasks here, a JSON string is acceptable and it seems like, just from my first impression, it's a lot harder to mess up (I could see lots of weird edge cases with multi-line shell arguments.

What are your thoughts on potentially allowing this to be read from a file specified in the command as well (as an alternative to the really long string)?

My strawman piggyback:

$ builder envs \
... \
TASK \
JSON_STRING ||  --envs_file=JSON_FILE_PATH

@ryan-roemer
Copy link
Member Author

@chaseadamsio -- Makes sense. Updated strawman to:

$ builder envs \
  --tries=3 \
  --queue=3 \
  --envs-path=FILE_PATH \
  TASK \
  JSON_STRING

@curiouslychase
Copy link

👍

ryan-roemer added a commit that referenced this issue Dec 8, 2015
Fixes #29

* Implement 'builder envs'
* Add flag '--envs-path'
* Update documentation.
* Add tests for args for envs action.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants