@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class)
public class HttpRetriever
extends org.jenkinsci.plugins.workflow.libs.LibraryRetriever
The current official plugin (workflow-cps-global-lib) does provide only a way to retrieve shared libraries through a SCM, such as Git, Subversion, etc.
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpRetriever.DescriptorImpl |
ExtensionPoint.LegacyInstancesAreScopedToHudson| Constructor and Description |
|---|
HttpRetriever(String httpURL,
String credentialsId)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
String |
getCredentialsId()
Accessor for credentials ID that can be used to do an authenticated download
|
org.jenkinsci.plugins.workflow.libs.LibraryRetrieverDescriptor |
getDescriptor() |
String |
getHttpURL()
Accessor for URL template where the library can be downloaded
|
void |
retrieve(String name,
String version,
boolean changelog,
FilePath target,
Run<?,?> run,
TaskListener listener)
Checks first if the library is accessible via a HEAD call.
|
void |
retrieve(String name,
String version,
FilePath target,
Run<?,?> run,
TaskListener listener)
Retrieves the shared library code.
|
FormValidation |
validateVersion(String name,
String version)
Validates version.
|
public String getHttpURL()
public String getCredentialsId()
public void retrieve(@Nonnull String name, @Nonnull String version, @Nonnull FilePath target, @Nonnull Run<?,?> run, @Nonnull TaskListener listener) throws Exception
Checks first if the library is accessible via a HEAD call. Then retrieves the shared library through HTTP protocol.
retrieve in class org.jenkinsci.plugins.workflow.libs.LibraryRetrievername - Name of the library (as specified in the Jenkinsfile @Library)version - Version of the library (as specified in the Jenkinsfile @Library)target - Where the code should be retrievedrun - Jenkins contextlistener - Only used to get the loggerException - if the file cannot be downloaded, archive can't be extracted, workspace is not writablepublic void retrieve(@Nonnull String name, @Nonnull String version, @Nonnull boolean changelog, @Nonnull FilePath target, @Nonnull Run<?,?> run, @Nonnull TaskListener listener) throws Exception
retrieve in class org.jenkinsci.plugins.workflow.libs.LibraryRetrievername - Name of the library (as specified in the Jenkinsfile @Library)version - Version of the library (as specified in the Jenkinsfile @Library)changelog - Not usedtarget - Where the code should be retrievedrun - Jenkins contextlistener - Only used to get the loggerException - if the file cannot be downloaded, archive can't be extracted, workspace is not writablepublic FormValidation validateVersion(@Nonnull String name, @Nonnull String version)
Replaces the pattern ${library.NAME.version} in the URL (if found in the shared library URL) either by the default version specified in the admin configuration page or by the user in the Jenkinsfile @Library call.
validateVersion in class org.jenkinsci.plugins.workflow.libs.LibraryRetrievername - Name of the libraryversion - Version of the librarypublic org.jenkinsci.plugins.workflow.libs.LibraryRetrieverDescriptor getDescriptor()
getDescriptor in interface Describable<org.jenkinsci.plugins.workflow.libs.LibraryRetriever>getDescriptor in class org.jenkinsci.plugins.workflow.libs.LibraryRetrieverCopyright © 2016–2019. All rights reserved.