Skip to content

Commit

Permalink
[FIXES JENKINS-9964] Expose the node name via the API and the GUI.
Browse files Browse the repository at this point in the history
* 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 f5026b9
Show file tree
Hide file tree
Showing 9 changed files with 625 additions and 0 deletions.
580 changes: 580 additions & 0 deletions src/images/logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/main/java/hudson/plugins/mercurial/MercurialTagAction.java
Expand Up @@ -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
Expand All @@ -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.
*/
Expand All @@ -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 added src/main/webapp/images/16x16/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/webapp/images/24x24/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/webapp/images/32x32/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/webapp/images/48x48/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f5026b9

Please sign in to comment.