java.lang.Object
org.jenkinsci.plugins.workflow.cps.GlobalVariable
org.jenkinsci.plugins.workflow.multibranch.SCMVar
All Implemented Interfaces:
ExtensionPoint

@Extension public class SCMVar extends org.jenkinsci.plugins.workflow.cps.GlobalVariable
Adds an scm global variable to the script. This makes it possible to run checkout scm to get your project sources in the right branch.
  • Constructor Details

    • SCMVar

      public SCMVar()
  • Method Details

    • getName

      @NonNull public String getName()
      Specified by:
      getName in class org.jenkinsci.plugins.workflow.cps.GlobalVariable
    • getValue

      @NonNull public SCM getValue(@NonNull org.jenkinsci.plugins.workflow.cps.CpsScript script) throws Exception
      Specified by:
      getValue in class org.jenkinsci.plugins.workflow.cps.GlobalVariable
      Throws:
      Exception