Class GitLabServer
java.lang.Object
hudson.model.AbstractDescribableImpl<GitLabServer>
io.jenkins.plugins.gitlabserverconfig.servers.GitLabServer
- All Implemented Interfaces:
Describable<GitLabServer>
Represents a GitLab Server instance.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.cloudbees.plugins.credentials.CredentialsMatcherThe credentials matcher for PersonalAccessToken and StringCredentialsstatic final StringUsed as default token value if no any credentials found by given credentialsId.static final StringDefault name for community SaaS version serverstatic final StringUsed as default community SaaS version server URL for the serverUrl fieldstatic final Loggerstatic final com.cloudbees.plugins.credentials.CredentialsMatcherThe credentials matcher for StringCredentials -
Constructor Summary
ConstructorsConstructorDescriptionGitLabServer(String serverUrl, String name, String credentialsId) Data Bound Constructor for only mandatory parameter serverUrl -
Method Summary
Modifier and TypeMethodDescriptioncom.cloudbees.plugins.credentials.common.StandardCredentialsgetCredentials(AccessControlled context) Looks up for PersonalAccessToken and StringCredentialsReturns TheIdCredentials.getId()of the credentials to use for GitLab Server Authentication to access GitLab APIs.getName()Deprecated.org.jenkinsci.plugins.plaincredentials.StringCredentialsLooks up for StringCredentialsbooleanReturnstrueif Jenkins should trigger a build immediately on a GitLab Web Hook trigger.booleanReturnstrueif Jenkins is supposed to auto-manage system hooks for this end-point.booleanReturnstrueif Jenkins is supposed to auto-manage web hooks for this end-point.voidsetHooksRootUrl(String hooksRootUrl) voidsetHookTriggerDelay(String hookTriggerDelay) Data Bound Setter for web hook trigger delayvoidsetImmediateHookTrigger(boolean immediateHookTrigger) Data Bound Setter for immediate build on a GitLab Web Hook trigger.voidsetManageSystemHooks(boolean manageSystemHooks) Data Bound Setter for auto management of system hooksvoidsetManageWebHooks(boolean manageWebHooks) Data Bound Setter for auto management of web hooksvoidsetSecretToken(Secret token) Deprecated.void
-
Field Details
-
CREDENTIALS_MATCHER
public static final com.cloudbees.plugins.credentials.CredentialsMatcher CREDENTIALS_MATCHERThe credentials matcher for PersonalAccessToken and StringCredentials -
GITLAB_SERVER_DEFAULT_NAME
Default name for community SaaS version server- See Also:
-
GITLAB_SERVER_URL
Used as default community SaaS version server URL for the serverUrl field- See Also:
-
EMPTY_TOKEN
Used as default token value if no any credentials found by given credentialsId.- See Also:
-
LOGGER
-
WEBHOOK_SECRET_CREDENTIALS_MATCHER
public static final com.cloudbees.plugins.credentials.CredentialsMatcher WEBHOOK_SECRET_CREDENTIALS_MATCHERThe credentials matcher for StringCredentials
-
-
Constructor Details
-
GitLabServer
@DataBoundConstructor public GitLabServer(@NonNull String serverUrl, @NonNull String name, @NonNull String credentialsId) Data Bound Constructor for only mandatory parameter serverUrl- Parameters:
serverUrl- The URL of this GitLab Servername- A unique name to use to describe the end-point, if empty replaced with a random namecredentialsId- TheIdCredentials.getId()of the credentials to use for GitLab Server Authentication to access GitLab APIs
-
-
Method Details
-
getName
-
getServerUrl
-
isManageWebHooks
public boolean isManageWebHooks()Returnstrueif Jenkins is supposed to auto-manage web hooks for this end-point.- Returns:
trueif Jenkins is supposed to auto-manage web hooks for this end-point.
-
setManageWebHooks
@DataBoundSetter public void setManageWebHooks(boolean manageWebHooks) Data Bound Setter for auto management of web hooks- Parameters:
manageWebHooks-trueif and only if Jenkins is supposed to auto-manage web hooks for this end-point.
-
isManageSystemHooks
public boolean isManageSystemHooks()Returnstrueif Jenkins is supposed to auto-manage system hooks for this end-point.- Returns:
trueif Jenkins is supposed to auto-manage system hooks for this end-point.
-
setManageSystemHooks
@DataBoundSetter public void setManageSystemHooks(boolean manageSystemHooks) Data Bound Setter for auto management of system hooks- Parameters:
manageSystemHooks-trueif and only if Jenkins is supposed to auto-manage system hooks for this end-point.
-
getCredentialsId
Returns TheIdCredentials.getId()of the credentials to use for GitLab Server Authentication to access GitLab APIs.- Returns:
- The
IdCredentials.getId()of the credentials to use for GitLab Server Authentication to access GitLab APIs.
-
getCredentials
public com.cloudbees.plugins.credentials.common.StandardCredentials getCredentials(AccessControlled context) Looks up for PersonalAccessToken and StringCredentials- Returns:
StandardCredentials
-
setHooksRootUrl
- Parameters:
hooksRootUrl- a custom root URL, to be used in hooks instead ofJenkins.getRootUrl(). Set tonullfor default behavior.
-
getHooksRootUrl
- Returns:
- the custom root URL, to be used in hooks instead of
Jenkins.getRootUrl(). Can be either a root URL with its trailing slash, ornull.
-
setSecretToken
Deprecated. -
setWebhookSecretCredentialsId
-
getWebhookSecretCredentialsId
-
getWebhookSecretCredentials
public org.jenkinsci.plugins.plaincredentials.StringCredentials getWebhookSecretCredentials(AccessControlled context) Looks up for StringCredentials- Returns:
StringCredentials
-
getDescriptor
- Specified by:
getDescriptorin interfaceDescribable<GitLabServer>- Overrides:
getDescriptorin classAbstractDescribableImpl<GitLabServer>
-
getSecretToken
Deprecated. -
getSecretTokenAsPlainText
-
isImmediateHookTrigger
public boolean isImmediateHookTrigger()Returnstrueif Jenkins should trigger a build immediately on a GitLab Web Hook trigger.- Returns:
trueif Jenkins should trigger a build immediately on a GitLab Web Hook trigger.
-
setImmediateHookTrigger
@DataBoundSetter public void setImmediateHookTrigger(boolean immediateHookTrigger) Data Bound Setter for immediate build on a GitLab Web Hook trigger.- Parameters:
immediateHookTrigger-trueif and only if Jenkins should trigger a build immediately on a GitLab Web Hook trigger.
-
setHookTriggerDelay
Data Bound Setter for web hook trigger delay- Parameters:
hookTriggerDelay- Delay to be used for GitLab Web Hook build triggers. Set tonullto use delay equal to GitLab cache timeout, which will avoid builds being not triggered due to GitLab caching.
-
getHookTriggerDelay
- Returns:
- Delay to be used for GitLab Web Hook build triggers.
Can be either a root URL with its trailing slash, or
null. Can benullto request delay to be equal to GitLab cache timeout.
-