Class GitRevisionTokenMacro

  • All Implemented Interfaces:
    ExtensionPoint

    @Extension(optional=true)
    public class GitRevisionTokenMacro
    extends org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro
    GIT_REVISION token that expands to the SHA1 of the commit that was built.
    Author:
    Kohsuke Kawaguchi
    • Field Detail

      • length

        public int length
        Number of chars to use
    • Constructor Detail

      • GitRevisionTokenMacro

        public GitRevisionTokenMacro()
    • Method Detail

      • acceptsMacroName

        public boolean acceptsMacroName​(String macroName)
        Specified by:
        acceptsMacroName in class org.jenkinsci.plugins.tokenmacro.TokenMacro
      • evaluate

        public String evaluate​(Run<?,​?> context,
                               FilePath workspace,
                               TaskListener listener,
                               String macroName)
                        throws org.jenkinsci.plugins.tokenmacro.MacroEvaluationException
        Overrides:
        evaluate in class org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro
        Throws:
        org.jenkinsci.plugins.tokenmacro.MacroEvaluationException