Class Pipeline
- All Implemented Interfaces:
Configurable
,KeyVal.Mixin
,UtilsMixin
/*
* Copyright 2021 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.
*/
GoCD.script {
pipelines {
pipeline('website') {
trackingTool {
link = 'https://github.com/gocd/gocd/issues/${ID}'
regex = ~/##(\\d+)/
}
materials {
git {
url = 'https://github.com/gocd/www.go.cd'
}
}
stages {
stage('build-website') {
jobs {
job('build') {
tasks {
exec {
commandLine = ['bundle', 'install']
}
exec {
commandLine = ['bundle', 'exec', 'rake', 'build']
}
}
artifacts {
build {
source = 'target/jcoverage'
destination = 'Jcoverage'
}
}
tabs {
tab('JCoverage') { path = 'Jcoverage/index.html' }
}
}
}
}
}
}
}
}
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Use this integer to order the display of pipelines on the dashboard.getGroup()
The name of the pipeline group that this pipeline belongs to.Pipeline label templates provide a means to label a pipeline or artifacts using a counter, or material revision (or both).The possible values arenone
,lockOnFailure
orunlockWhenFinished
.The list of parameter substitutions to be used in a pipeline or a template.The name of the template that this pipeline references.int
hashCode()
void
setDisplayOrder
(Integer displayOrder) Use this integer to order the display of pipelines on the dashboard.void
The name of the pipeline group that this pipeline belongs to.void
setLabelTemplate
(String labelTemplate) Pipeline label templates provide a means to label a pipeline or artifacts using a counter, or material revision (or both).void
setLockBehavior
(String lockBehavior) The possible values arenone
,lockOnFailure
orunlockWhenFinished
.void
The list of parameter substitutions to be used in a pipeline or a template.void
setTemplate
(String template) The name of the template that this pipeline references.toString()
trackingTool
(Closure cl) Methods inherited from class cd.go.contrib.plugins.configrepo.groovy.dsl.HasEnvironmentVariables
getEnvironmentVariables, getSecureEnvironmentVariables, setEnvironmentVariables, setSecureEnvironmentVariables
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.UtilsMixin
sanitizeName
-
Constructor Details
-
Pipeline
public Pipeline() -
Pipeline
-
Pipeline
-
-
Method Details
-
trackingTool
- See Also:
-
timer
- See Also:
-
materials
- See Also:
-
stages
- See Also:
-
getGroup
The name of the pipeline group that this pipeline belongs to. -
getDisplayOrder
Use this integer to order the display of pipelines on the dashboard. If multiple pipelines have the samedisplayOrder
value, their order relative to each other will be indeterminate. -
getLabelTemplate
Pipeline label templates provide a means to label a pipeline or artifacts using a counter, or material revision (or both).Valid substitutions are:
Valid substitutions ${COUNT} The pipeline counter (starts at 1). ${<material-name>} The revision of the material named "material-name". The "material-name" can be the name of an SCM material, or a pipeline material. ${<material-name>[:<length>]} The first "length" characters of revision of the material named "material-name". #{<parameter-name>} Substitute the value of the parameter named "parameter-name". An example of a label template is:
15.1-${COUNT}
or15.1-${COUNT}-${svn}
or15.1-${COUNT}-${git[:7]}
-
getLockBehavior
The possible values arenone
,lockOnFailure
orunlockWhenFinished
.When set to
lockOnFailure
, GoCD ensures that only a single instance of a pipeline can be run at a time and the pipeline will be locked if it fails, unless it is the last stage which fails.When set to
unlockWhenFinished
, GoCD ensures that only a single instance of a pipeline can be run at a time, and the pipeline will be unlocked as soon as it finishes (success or failure), or reaches a manual stage.The default value is
none
. -
getTemplate
The name of the template that this pipeline references. If set, no stages may be defined in this pipeline. -
getParams
The list of parameter substitutions to be used in a pipeline or a template./*
* Copyright 2021 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('build') {
params = [
OS : 'linux',
BROWSER: 'firefox'
]
stages {
stage('foo') {
jobs {
job('foo') {
tasks {
exec {
commandLine = ['./gradle', 'test', '-Pos=#{OS}', '-Pbrowser=#{BROWSER}']
}
}
}
}
}
}
}
- See Also:
-
setGroup
The name of the pipeline group that this pipeline belongs to. -
setDisplayOrder
Use this integer to order the display of pipelines on the dashboard. If multiple pipelines have the samedisplayOrder
value, their order relative to each other will be indeterminate. -
setLabelTemplate
Pipeline label templates provide a means to label a pipeline or artifacts using a counter, or material revision (or both).Valid substitutions are:
Valid substitutions ${COUNT} The pipeline counter (starts at 1). ${<material-name>} The revision of the material named "material-name". The "material-name" can be the name of an SCM material, or a pipeline material. ${<material-name>[:<length>]} The first "length" characters of revision of the material named "material-name". #{<parameter-name>} Substitute the value of the parameter named "parameter-name". An example of a label template is:
15.1-${COUNT}
or15.1-${COUNT}-${svn}
or15.1-${COUNT}-${git[:7]}
-
setLockBehavior
The possible values arenone
,lockOnFailure
orunlockWhenFinished
.When set to
lockOnFailure
, GoCD ensures that only a single instance of a pipeline can be run at a time and the pipeline will be locked if it fails, unless it is the last stage which fails.When set to
unlockWhenFinished
, GoCD ensures that only a single instance of a pipeline can be run at a time, and the pipeline will be unlocked as soon as it finishes (success or failure), or reaches a manual stage.The default value is
none
. -
setTemplate
The name of the template that this pipeline references. If set, no stages may be defined in this pipeline. -
setParams
The list of parameter substitutions to be used in a pipeline or a template./*
* Copyright 2021 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('build') {
params = [
OS : 'linux',
BROWSER: 'firefox'
]
stages {
stage('foo') {
jobs {
job('foo') {
tasks {
exec {
commandLine = ['./gradle', 'test', '-Pos=#{OS}', '-Pbrowser=#{BROWSER}']
}
}
}
}
}
}
}
- See Also:
-
equals
- Overrides:
equals
in classHasEnvironmentVariables<Pipeline>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classHasEnvironmentVariables<Pipeline>
-
toString
- Overrides:
toString
in classHasEnvironmentVariables<Pipeline>
-