Skip to content

Commit

Permalink
Merge pull request #15 from sinstein/master
Browse files Browse the repository at this point in the history
Username suffix for tracking sessions run via TeamCity
  • Loading branch information
vedharish authored May 2, 2017
2 parents fa7e21d + aeb92ac commit fc0cf34
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion browserstack-teamcity-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>browserstack-teamcity</artifactId>
<groupId>com.browserstack</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>

<artifactId>browserstack-teamcity-agent</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,16 @@ 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;
}

runner.addEnvironmentVariable(EnvVars.BROWSERSTACK_USERNAME, config.get(EnvVars.BROWSERSTACK_USERNAME));
runner.addEnvironmentVariable(EnvVars.BROWSERSTACK_ACCESS_KEY, config.get(EnvVars.BROWSERSTACK_ACCESS_KEY));
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");
runner.addEnvironmentVariable(EnvVars.BROWSERSTACK_USER, username + "-teamcity");
runner.addEnvironmentVariable(EnvVars.BROWSERSTACK_ACCESS_KEY, accesskey);
runner.addEnvironmentVariable(EnvVars.BROWSERSTACK_ACCESSKEY, accesskey);
runner.addEnvironmentVariable(EnvVars.BROWSERSTACK_LOCAL, config.get(EnvVars.BROWSERSTACK_LOCAL));

BuildProgressLogger buildLogger = runner.getBuild().getBuildLogger();
Expand Down
2 changes: 1 addition & 1 deletion browserstack-teamcity-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>browserstack-teamcity</artifactId>
<groupId>com.browserstack</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>
<artifactId>browserstack-teamcity-common</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ public class BrowserStackParameters {

public interface EnvVars {
String BROWSERSTACK_USERNAME = "BROWSERSTACK_USERNAME";
String BROWSERSTACK_USER = "BROWSERSTACK_USER";
String BROWSERSTACK_ACCESS_KEY = "BROWSERSTACK_ACCESS_KEY";
String BROWSERSTACK_ACCESSKEY = "BROWSERSTACK_ACCESSKEY";
String BROWSERSTACK_LOCAL = "BROWSERSTACK_LOCAL";
String BROWSERSTACK_LOCAL_IDENTIFIER = "BROWSERSTACK_LOCAL_IDENTIFIER";
String BROWSERSTACK_BUILD = "BROWSERSTACK_BUILD";
Expand Down
2 changes: 1 addition & 1 deletion browserstack-teamcity-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>browserstack-teamcity</artifactId>
<groupId>com.browserstack</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>
<artifactId>browserstack-teamcity-server</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>browserstack-teamcity</artifactId>
<groupId>com.browserstack</groupId>
<version>1.0.1</version>
<version>1.0.2</version>
</parent>

<artifactId>build</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.browserstack</groupId>
<artifactId>browserstack-teamcity</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
<packaging>pom</packaging>

<properties>
Expand Down

0 comments on commit fc0cf34

Please sign in to comment.