Class WithEphemeralCredentialsGlobalVariable

java.lang.Object
org.jenkinsci.plugins.workflow.cps.GlobalVariable
io.jenkins.plugins.ephemeral_credentials.WithEphemeralCredentialsGlobalVariable
All Implemented Interfaces:
ExtensionPoint

@Extension public class WithEphemeralCredentialsGlobalVariable extends org.jenkinsci.plugins.workflow.cps.GlobalVariable

Registers withEphemeralCredentials as a global pipeline step, available in any Pipeline job once this plugin is installed - no @Library import needed, same as lock or input.

The actual implementation (WithEphemeralCredentials.groovy) ships as a plugin resource, not precompiled, and is parsed on demand through the calling script's own GroovyClassLoader - the same technique docker-workflow-plugin's DockerDSL uses for its Docker.groovy - so it gets the same CPS transformation as a shared-library vars/src script, which is what makes its calls to lock/input safe. The source is read via this class's own classloader (which can always find our plugin's resources) and handed directly to parseClass, rather than relying on the CPS classloader's loadClass to independently discover a .groovy resource across plugin boundaries - that discovery path isn't guaranteed to search other plugins' jars.

See also the WithEphemeralCredentials step (provided in WithEphemeralCredentials.groovy source file).

See Also:
  • Constructor Details

    • WithEphemeralCredentialsGlobalVariable

      public WithEphemeralCredentialsGlobalVariable()
  • Method Details

    • getName

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

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