org.jenkinsci.plugins.badge
Class PublicBadgeAction

java.lang.Object
  extended by org.jenkinsci.plugins.badge.PublicBadgeAction
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Action, hudson.model.ModelObject, hudson.model.RootAction, hudson.model.UnprotectedRootAction

@Extension
public class PublicBadgeAction
extends Object
implements hudson.model.UnprotectedRootAction

Exposes the build status badge via unprotected URL. The status of a job can be checked like this:

  • http://localhost:8080/buildstatus/icon?job=[JOBNAME]
  • e.g. http://localhost:8080/buildstatus/icon?job=free1

    The status of a particular build can be checked like this:
  • http://localhost:8080/buildstatus/icon?job=[JOBNAME]&build=[BUILDNUMBER]
  • e.g. http://localhost:8080/buildstatus/icon?job=free1&build=5

    Even though the URL is unprotected, the user does still need the 'ViewStatus' permission on the given Job. If you want the status icons to be public readable/accessible, just grant the 'ViewStatus' permission globally to 'anonymous'.

    Author:
    Dominik Bartholdi (imod)

    Nested Class Summary
     
    Nested classes/interfaces inherited from interface hudson.ExtensionPoint
    hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
     
    Field Summary
    static hudson.security.Permission VIEW_STATUS
               
     
    Constructor Summary
    PublicBadgeAction()
               
     
    Method Summary
     org.kohsuke.stapler.HttpResponse doIcon(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String job, String build)
              Serves the badge image.
     String getDisplayName()
               
     String getIconFileName()
               
     String getUrlName()
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    VIEW_STATUS

    public static final hudson.security.Permission VIEW_STATUS
    Constructor Detail

    PublicBadgeAction

    public PublicBadgeAction()
                      throws IOException
    Throws:
    IOException
    Method Detail

    getUrlName

    public String getUrlName()
    Specified by:
    getUrlName in interface hudson.model.Action

    getIconFileName

    public String getIconFileName()
    Specified by:
    getIconFileName in interface hudson.model.Action

    getDisplayName

    public String getDisplayName()
    Specified by:
    getDisplayName in interface hudson.model.Action
    Specified by:
    getDisplayName in interface hudson.model.ModelObject

    doIcon

    public org.kohsuke.stapler.HttpResponse doIcon(org.kohsuke.stapler.StaplerRequest req,
                                                   org.kohsuke.stapler.StaplerResponse rsp,
                                                   @QueryParameter
                                                   String job,
                                                   @QueryParameter
                                                   String build)
    Serves the badge image.



    Copyright © 2004-2014. All Rights Reserved.