This step sets the default job properties.
This is done by default in the
defaultBuildWrapper
](defaultBuildWrapper.md) so the steps using the
default wrapper:
are implicit using this step.
- no auto rebuild
- rebuild is enabled
[$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false]
❗ In version 0.8 the default triggers were removed!
But you can define triggers by configuration instead!
- keep builds 365 days
- keep up to 50 builds
- keep no artifacts
buildDiscarder(
logRotator(
artifactDaysToKeepStr: '',
artifactNumToKeepStr: '',
daysToKeepStr: '365',
numToKeepStr: '50'
)
)
- disable concurrent builds
disableConcurrentBuilds()
All configuration options must be inside the properties
(ConfigConstants.PROPERTIES
)
map element to be evaluated and used by the step.
import static de.provision.devops.jenkins.pipeline.utils.ConfigConstants.*
import static io.wcm.devops.jenkins.pipeline.utils.ConfigConstants.*
setJobProperties(
(PROPERTIES) : [
(PROPERTIES_BUILD_DISCARDER) : [
(PROPERTIES_BUILD_DISCARDER_ARTIFACT_DAYS_TO_KEEP) : '',
(PROPERTIES_BUILD_DISCARDER_ARTIFACT_NUM_TO_KEEP) : '',
(PROPERTIES_BUILD_DISCARDER_DAYS_TO_KEEP) : '365',
(PROPERTIES_BUILD_DISCARDER_NUM_TO_KEEP) : '50'
],
(PROPERTIES_DISABLE_CONCURRENT_BUILDS) : true,
(PROPERTIES_PARAMETERS) : [
// default: empty
],
(PROPERTIES_PIPELINE_TRIGGERS) : [
// default: empty
],
(PROPERTIES_CUSTOM) : [
// default: empty
],
],
)
Constant | ConfigConstants.PROPERTIES_BUILD_DISCARDER |
Type | Map containing configuration options for logrotator |
Default | see below |
Use this configuration option to define the build discarding / log rotation
Default:
(PROPERTIES_BUILD_DISCARDER) : [
(PROPERTIES_BUILD_DISCARDER_ARTIFACT_DAYS_TO_KEEP) : '',
(PROPERTIES_BUILD_DISCARDER_ARTIFACT_NUM_TO_KEEP) : '',
(PROPERTIES_BUILD_DISCARDER_DAYS_TO_KEEP) : '365',
(PROPERTIES_BUILD_DISCARDER_NUM_TO_KEEP) : '50'
]
Constant | ConfigConstants.PROPERTIES_BUILD_DISCARDER_ARTIFACT_DAYS_TO_KEEP |
Type | String Days to keep build artifacts |
Default | '' |
Use this configuration option to define how many days artifacts will be kept.
Constant | ConfigConstants.PROPERTIES_BUILD_DISCARDER_ARTIFACT_NUM_TO_KEEP |
Type | String Number of artifacts to keep |
Default | '' |
Use this configuration option to define how many artifacts will be kept.
Constant | ConfigConstants.PROPERTIES_BUILD_DISCARDER_DAYS_TO_KEEP |
Type | String Days to keep build |
Default | '365' (Build will be kept max 365 days) |
Use this configuration option to define how many days the builds will be kept.
Constant | ConfigConstants.PROPERTIES_BUILD_DISCARDER_NUM_TO_KEEP |
Type | String Number of builds to keep |
Default | '50' (Max 50 builds will be kept) |
Use this configuration option to define how many builds will be kept.
Constant | ConfigConstants.PROPERTIES_CUSTOM |
Type | List of custom 'raw' pipeline properties |
Default | [] |
Use this configuration option to set custom properties like:
[$class: 'BuildBlockerProperty', blockLevel: 'GLOBAL', blockingJobs: '.*blocking-job.*', scanQueueFor: 'DISABLED', useBuildBlocker: true]
💡 See https://jenkins.io/doc/pipeline/steps/ for more information about syntax.
Constant | ConfigConstants.PROPERTIES_DISABLE_CONCURRENT_BUILDS |
Type | Boolean |
Default | true |
Use this configuration option to disable / enable concurrent builds. Per default concurrent builds are disabled.
Constant | ConfigConstants.PROPERTIES_PARAMETERS |
Type | List of parameter definitions |
Default | [] |
Use this configuration option to the pipeline triggers.
💡 See https://jenkins.io/doc/book/pipeline/syntax/#parameters for more information about syntax.
Constant | ConfigConstants.PROPERTIES_PIPELINE_TRIGGERS |
Type | List of pipeline triggers |
Default | [] |
Use this configuration option to the pipeline triggers.
💡 See https://jenkins.io/doc/book/pipeline/syntax/#triggers for more information about syntax.