Skip to content

Commit

Permalink
[JENKINS-26671] Multiple description setter build steps should append
Browse files Browse the repository at this point in the history
...

This commit fixes [JENKINS-26671]: Multiple description setter build
steps
should append to build description]
At the same time it also fixes [JENKINS-14198]: Ability to append a
description to existing description for use with flexible publish
  • Loading branch information
michael authored and michael committed Mar 16, 2015
1 parent 965d2e9 commit 3b98efa
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
@@ -1,2 +1,6 @@
description-setter.iml
target/
work/
.project
.classpath
.settings
Expand Up @@ -60,7 +60,17 @@ public static boolean setDescription(AbstractBuild<?, ?> build,
result = urlify(result);

build.addAction(new DescriptionSetterAction(result));
build.setDescription(result);
if(build.getDescription() == null)
{
build.setDescription(result);
}
else
{
String oldDescr = build.getDescription();
String newDescr = oldDescr + "<br />" + result;
build.setDescription(newDescr);
}

listener.getLogger().println(LOG_PREFIX + " Description set: " + result);
} catch (IOException e) {
e.printStackTrace(listener.error(LOG_PREFIX
Expand Down
Expand Up @@ -156,6 +156,12 @@ public boolean endRun(MatrixRun run) throws InterruptedException,
&& run.getDescription() != null) {
build.setDescription(run.getDescription());
}
else if(build.getDescription() != null && run.getDescription() != null)
{
String oldDescr = build.getDescription();
String newDescr = oldDescr + "<br />" + run.getDescription();
build.setDescription(newDescr);
}
return true;
}
};
Expand Down

0 comments on commit 3b98efa

Please sign in to comment.