Skip to content

Commit

Permalink
Check for both variants of username and access key
Browse files Browse the repository at this point in the history
  • Loading branch information
sinstein committed Apr 28, 2017
1 parent be029f3 commit aeb92ac
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ private void loadBuildFeature(final AgentRunningBuild build) {
* @param config
*/
private void exportEnvVars(final BuildRunnerContext runner, final Map<String, String> config) {
if (!config.containsKey(EnvVars.BROWSERSTACK_USERNAME) || !config.containsKey(EnvVars.BROWSERSTACK_ACCESS_KEY)) {
return;
if(!((config.containsKey(EnvVars.BROWSERSTACK_USERNAME) || config.containsKey(EnvVars.BROWSERSTACK_USER)) && (config.containsKey(EnvVars.BROWSERSTACK_ACCESS_KEY) || config.containsKey(EnvVars.BROWSERSTACK_ACCESSKEY)))) {
return;
}

String username = config.get(EnvVars.BROWSERSTACK_USERNAME) == null ? config.get(EnvVars.BROWSERSTACK_USER) : config.get(EnvVars.BROWSERSTACK_USERNAME);
String accesskey = config.get(EnvVars.BROWSERSTACK_ACCESS_KEY) == null ? config.get(EnvVars.BROWSERSTACK_ACCESSKEY) : config.get(EnvVars.BROWSERSTACK_ACCESS_KEY);
runner.addEnvironmentVariable(EnvVars.BROWSERSTACK_USERNAME, username + "-teamcity");
Expand Down

0 comments on commit aeb92ac

Please sign in to comment.