Class GitMaterial
- All Implemented Interfaces:
Configurable
,KeyVal.Mixin
,Notifies.MaterialMixin
,UtilsMixin
/*
* Copyright 2022 Thoughtworks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
pipeline('docs-website') {
materials {
git {
url = 'https://github.com/gocd/gocd'
branch = 'develop'
blacklist = ['README.md', 'docs/**']
username = 'bob'
// see https://api.gocd.org/current/#encrypt-a-plain-text-value
encryptedPassword = 'aSdiFgRRZ6A='
}
}
}
- See Also:
-
Constructor Summary
ConstructorDescriptionGitMaterial
(Closure<?> cl) GitMaterial
(String name, Closure<?> cl) GitMaterial
(String name, Consumer<GitMaterial> configure) -
Method Summary
Modifier and TypeMethodDescriptionboolean
The git branch.Add a--depth=N
option to git cloning command on GoCD agent.getUrl()
The url of the git repository.int
hashCode()
void
The git branch.void
setShallowClone
(Boolean shallowClone) Add a--depth=N
option to git cloning command on GoCD agent.void
The url of the git repository.toString()
Methods inherited from class cd.go.contrib.plugins.configrepo.groovy.dsl.ScmMaterial
getAutoUpdate, getBlacklist, getDestination, getEncryptedPassword, getPassword, getUsername, getWhitelist, setAutoUpdate, setBlacklist, setDestination, setEncryptedPassword, setPassword, setUsername, setWhitelist
Methods inherited from interface cd.go.contrib.plugins.configrepo.groovy.dsl.mixins.Configurable
configure
Methods inherited from interface cd.go.contrib.plugins.configrepo.groovy.dsl.mixins.KeyVal.Mixin
lookup, lookup
Methods inherited from interface cd.go.contrib.plugins.configrepo.groovy.dsl.mixins.Notifies.MaterialMixin
notifiesBitbucketAt, notifiesBitbucketSelfHostedAt, notifiesBy, notifiesGitHubAt, notifiesGitLabAt
Methods inherited from interface cd.go.contrib.plugins.configrepo.groovy.dsl.mixins.UtilsMixin
sanitizeName
-
Constructor Details
-
GitMaterial
public GitMaterial() -
GitMaterial
-
GitMaterial
-
GitMaterial
-
-
Method Details
-
dup
- Specified by:
dup
in classMaterial<GitMaterial>
-
getUrl
The url of the git repository. -
getBranch
The git branch. Defaults tomaster
. -
getShallowClone
Add a--depth=N
option to git cloning command on GoCD agent. Shallow clone truncates history to latest revisions, thus helps accelerating clone operation for repositories with long history.Clone depth is dynamically calculated to ensure revisions from GO_FROM_REVISION to GO_TO_REVISION are included in the cloned repository.
-
setUrl
The url of the git repository. -
setBranch
The git branch. Defaults tomaster
. -
setShallowClone
Add a--depth=N
option to git cloning command on GoCD agent. Shallow clone truncates history to latest revisions, thus helps accelerating clone operation for repositories with long history.Clone depth is dynamically calculated to ensure revisions from GO_FROM_REVISION to GO_TO_REVISION are included in the cloned repository.
-
equals
- Overrides:
equals
in classScmMaterial<GitMaterial>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classScmMaterial<GitMaterial>
-
toString
- Overrides:
toString
in classScmMaterial<GitMaterial>
-