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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.cloudbees.plugins.credentials.CredentialsMatcher
The credentials matcher for PersonalAccessToken and StringCredentialsstatic final String
Used as default token value if no any credentials found by given credentialsId.static final String
Default name for community SaaS version serverstatic final String
Used as default community SaaS version server URL for the serverUrl fieldstatic final Logger
static final com.cloudbees.plugins.credentials.CredentialsMatcher
The credentials matcher for StringCredentials -
Constructor Summary
ConstructorDescriptionGitLabServer
(String serverUrl, String name, String credentialsId) Data Bound Constructor for only mandatory parameter serverUrl -
Method Summary
Modifier and TypeMethodDescriptioncom.cloudbees.plugins.credentials.common.StandardCredentials
getCredentials
(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.StringCredentials
Looks up for StringCredentialsboolean
Returnstrue
if Jenkins should trigger a build immediately on a GitLab Web Hook trigger.boolean
Returnstrue
if Jenkins is supposed to auto-manage system hooks for this end-point.boolean
Returnstrue
if Jenkins is supposed to auto-manage web hooks for this end-point.void
setHooksRootUrl
(String hooksRootUrl) void
setHookTriggerDelay
(String hookTriggerDelay) Data Bound Setter for web hook trigger delayvoid
setImmediateHookTrigger
(boolean immediateHookTrigger) Data Bound Setter for immediate build on a GitLab Web Hook trigger.void
setManageSystemHooks
(boolean manageSystemHooks) Data Bound Setter for auto management of system hooksvoid
setManageWebHooks
(boolean manageWebHooks) Data Bound Setter for auto management of web hooksvoid
setSecretToken
(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()Returnstrue
if Jenkins is supposed to auto-manage web hooks for this end-point.- Returns:
true
if 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
-true
if and only if Jenkins is supposed to auto-manage web hooks for this end-point.
-
isManageSystemHooks
public boolean isManageSystemHooks()Returnstrue
if Jenkins is supposed to auto-manage system hooks for this end-point.- Returns:
true
if 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
-true
if 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 tonull
for 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:
getDescriptor
in interfaceDescribable<GitLabServer>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<GitLabServer>
-
getSecretToken
Deprecated. -
getSecretTokenAsPlainText
-
isImmediateHookTrigger
public boolean isImmediateHookTrigger()Returnstrue
if Jenkins should trigger a build immediately on a GitLab Web Hook trigger.- Returns:
true
if 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
-true
if 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 tonull
to 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 benull
to request delay to be equal to GitLab cache timeout.
-