Created
April 12, 2017 19:35
-
-
Save visitbethel/ce76b5dca568af6549ab641466d67404 to your computer and use it in GitHub Desktop.
Dynamic creation of properties for Pipeline initialization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def props = [] | |
if (config.enableReleaseControl) { | |
props.add( | |
[ | |
$class: 'ParametersDefinitionProperty', parameterDefinitions: [ | |
[$class: 'BooleanParameterDefinition', defaultValue: false, description: 'Perform release cut (1.0.0-SNAPSHOT to 1.0.0.1)', name : 'PERFORM_RELEASE_CUT'], | |
[$class: 'BooleanParameterDefinition', defaultValue: false, description: 'Perform incremental versioning from (1.0.0-SNAPSHOT to 1.0.1) mostly done after a sprint completion or demo', name : 'INCREMENTAL_VERSIONING'], | |
[$class: 'StringParameterDefinition', defaultValue: '', description: 'Placeholder for explicit release tag for manual assignment', name: 'RELEASE_TAG'] | |
] | |
] | |
) | |
} | |
def cron = config.cron ?: 'H/3 * * * *' | |
props.add( | |
pipelineTriggers([ | |
triggers: [ | |
[ | |
$class: 'hudson.triggers.SCMTrigger', | |
scmpoll_spec : cron | |
] | |
] | |
]) | |
) | |
// install the properties | |
properties( props ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment