Skip to content
Permalink
Browse files

[FIXES JENKINS-9964] Expose the node name via the API and the GUI.

* Added @ExportedBean and @exported to MercurialTagAction which exposes the information via the API

* Added index.jelly and summary.jelly for MercurialTagAction which exposed the information via the GUI

* Added the Mercurial logo for the Tag action.
  • Loading branch information...
stephenc committed Jun 13, 2011
1 parent cb28927 commit f5026b9683b75c0faabab4c3d367a3e530d92be7

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -3,13 +3,16 @@
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.model.AbstractBuild;
import hudson.scm.SCMRevisionState;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;

/**
* Action contributed to {@link AbstractBuild} from Mercurial.
*
* <p>
* Currently it just remembers the revision ID, but we want to extend this to cover tagging.
*/
@ExportedBean(defaultVisibility = 999)
public class MercurialTagAction extends SCMRevisionState {
// TODO: have this extends AbstractScmTagAction and offer after-the-fact tagging operation
// for now, we just remember the mercurial revision that was built in a given build
@@ -23,6 +26,11 @@ public MercurialTagAction(@NonNull String id) {
this.id = id;
}

@Exported(name = "mercurialNodeName")
public String getId() {
return id;
}

/**
* Mercurial often uses a short ID form that consists of 12 letters.
*/
@@ -34,4 +42,18 @@ public String getShortId() {
return "MercurialTagAction:" + id;
}

@Override
public String getIconFileName() {
return "/plugin/mercurial/images/32x32/logo.png";
}

@Override
public String getDisplayName() {
return Messages.MercurialTagAction_BuildData();
}

@Override
public String getUrlName() {
return "mercurial";
}
}
@@ -0,0 +1,13 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:layout title="Mercurial">


<l:main-panel>
<h1>Mercurial Build Data</h1>

<b>Revision:</b>
${it.id}
</l:main-panel>
</l:layout>
</j:jelly>
@@ -0,0 +1,9 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"
xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson"
xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<t:summary icon="/plugin/mercurial/images/48x48/logo.png">

<b>Revision</b>: ${it.id}

</t:summary>
</j:jelly>
@@ -0,0 +1 @@
MercurialTagAction.BuildData=Mercurial Build Data
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit f5026b9

Please sign in to comment.
You can’t perform that action at this time.