Skip to content

Commit

Permalink
[FIXED JENKINS-3785] Created a Publisher to create a label on TFS aft…
Browse files Browse the repository at this point in the history
…er the build. The label is created in the workspace version.
  • Loading branch information
rodrigolopes committed Feb 7, 2014
1 parent 53b6721 commit fd66871
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/main/java/hudson/plugins/tfs/commands/LabelCommand.java
Expand Up @@ -25,12 +25,17 @@ public MaskedArgumentListBuilder getArguments() {
arguments.add(labelName);
arguments.add(projectPath);
arguments.add(String.format("-version:W%s", workspaceName));
arguments.add("-comment");
arguments.add("Automatically applied by Jenkins TFS plugin");
arguments.add(String.format("-comment:%s", getLabelComment()));
arguments.add("-noprompt");
arguments.add("-recursive");
addServerArgument(arguments);
addLoginArgument(arguments);
return arguments;
}

private String getLabelComment() {
// TODO 1. Solve issue with quotes and spaces
// TODO 2. Include build information in the comment.
return "Automatically_applied_by_Jenkins_TFS_plugin";
}
}
Expand Up @@ -19,6 +19,6 @@ public void assertArguments() {

MaskedArgumentListBuilder arguments = new LabelCommand(config, "int_build.10", "Jenkins-JOB-MASTER", ".").getArguments();
assertNotNull("Arguments were null", arguments);
assertEquals("label int_build.10 . -version:WJenkins-JOB-MASTER -comment \"Automatically applied by Jenkins TFS plugin\" -noprompt -recursive -server:https://tfs02.codeplex.com -login:snd\\user_cp,password", arguments.toStringWithQuote());
assertEquals("label int_build.10 . -version:WJenkins-JOB-MASTER -comment:Automatically_applied_by_Jenkins_TFS_plugin -noprompt -recursive -server:https://tfs02.codeplex.com -login:snd\\user_cp,password", arguments.toStringWithQuote());
}
}

0 comments on commit fd66871

Please sign in to comment.