Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (22 sloc) 701 Bytes
import jenkins.model.*;
import org.jenkinsci.plugins.workflow.libs.*;
import jenkins.scm.api.SCMSource;
GlobalLibraries globalLibs = GlobalConfiguration.all().get(GlobalLibraries.class)
SCMSource scm = new jenkins.plugins.git.GitSCMSource(
"",
"http://gitserver:3000/butler/pipeline-libraries.git",
"",
"",
"",
false
)
LibraryRetriever libRetriever = new SCMSourceRetriever(scm)
LibraryConfiguration libConfig = new LibraryConfiguration(
"pipeline-libraries",
libRetriever
)
libConfig.setDefaultVersion("master")
libConfig.setImplicit(true)
List<LibraryConfiguration> libraries= new ArrayList<LibraryConfiguration>()
libraries.add(libConfig)
globalLibs.setLibraries(libraries)
You can’t perform that action at this time.