Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use .js/json files instead of .sh files? #4

Open
domenic opened this issue Apr 9, 2014 · 8 comments
Open

Use .js/json files instead of .sh files? #4

domenic opened this issue Apr 9, 2014 · 8 comments
Assignees

Comments

@domenic
Copy link

domenic commented Apr 9, 2014

For Windows compat and general better UX, simple key-value pairs could be stored in e.g. test/activate.json instead of in a .sh file that exports to process.env...

@kriskowal
Copy link
Member

Understood. This can be done, but it gets a bit ugly since we still have to support the variables from process.env if process.env.TRAVIS_JOB_ID exists. I’m not sure about the workflow with the Travis gem on Windows either, but presumably we can shell out to it from a Node.js process on Windows as well.

@domenic
Copy link
Author

domenic commented Apr 9, 2014

Hmm I'm not sure I understand. Why do we need to support variables from process.env?

@domenic
Copy link
Author

domenic commented Apr 9, 2014

Oh, because that's how Travis works, of course. Well in that case I am less sure. It's probably not worth bifurcating the development workflow vs. the Travis workflow.

Closing for now unless I think of something brilliant.

@domenic domenic closed this as completed Apr 9, 2014
@kriskowal
Copy link
Member

I figured we might have a function like get(name) that would check for Travis and go to the environment, or fall back to reading from env.json or some such. With the current workflow, npm run test:sauce will not work because it calls out to source activate.sh, which will certainly not work on Windows.

@domenic
Copy link
Author

domenic commented Apr 9, 2014

I guess the alternative would be to replace it with a .js file that sets process.env.XXX = YYY. That would work in both environments.

(This is a specific instance of the more general Windows-friendly strategy of replacing shell scripts with Node scripts.)

@kriskowal
Copy link
Member

Oh, that’d do the trick. Would have to conditionally load that module, which would work in this very specific case.

@domenic domenic reopened this Apr 9, 2014
@kriskowal
Copy link
Member

I ported the Saucelabs infrastructure to https://github.com/kriskowal/asap, but switched to using JSON for configuration, which could be encrypted for TravisCI and consumed through the environment if env.TRAVIS is defined. I intend to vend out the generalized scripts as another package, which we could then use here and in all projects in this cohort.

@domenic
Copy link
Author

domenic commented May 28, 2014

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants