Class WorkflowLibRepository

java.lang.Object
org.jenkinsci.plugins.gitserver.HttpGitRepository
org.jenkinsci.plugins.gitserver.FileBackedHttpGitRepository
org.jenkinsci.plugins.workflow.cps.global.WorkflowLibRepository
All Implemented Interfaces:
ExtensionPoint, Action, ModelObject, RootAction

@Extension public class WorkflowLibRepository extends org.jenkinsci.plugins.gitserver.FileBackedHttpGitRepository implements RootAction
Exposes the workflow libs as a git repository over HTTP.
Author:
Kohsuke Kawaguchi
  • Constructor Details

    • WorkflowLibRepository

      public WorkflowLibRepository()
  • Method Details

    • workspace

      public static File workspace()
      Get the root of the WorkflowLibRepository git repository on the controller. To use the repository for things other than UserDefinedGlobalVariables, call this to get the repository, and extend WorkflowLibRepositoryListener to listen for pushes to the repository in order to respond to those pushes by rebuilding stored classes/scripts, etc.
      Returns:
      A File pointing to the WorkflowLibRepository git repository on the controller.
    • checkPushPermission

      protected void checkPushPermission()
      Specified by:
      checkPushPermission in class org.jenkinsci.plugins.gitserver.FileBackedHttpGitRepository
    • getIconFileName

      public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
    • getUrlName

      public String getUrlName()
      Specified by:
      getUrlName in interface Action
    • createInitialRepository

      protected void createInitialRepository(org.eclipse.jgit.lib.Repository r) throws IOException
      Starts a new repository without initial import, since this directory was never unmanaged. This will create a nice empty repo that people can push into, as opposed to one they have to pull from. This prevents a user mistake like JENKINS-25632.
      Overrides:
      createInitialRepository in class org.jenkinsci.plugins.gitserver.FileBackedHttpGitRepository
      Throws:
      IOException
    • createReceivePack

      public org.eclipse.jgit.transport.ReceivePack createReceivePack(org.eclipse.jgit.lib.Repository db)
      Overrides:
      createReceivePack in class org.jenkinsci.plugins.gitserver.FileBackedHttpGitRepository