Last active
January 16, 2021 04:44
-
-
Save devopsblog/7b67cddcf9902e39a1ac55f42b930010 to your computer and use it in GitHub Desktop.
Set build description, disable concurrent builds and build discarder using declarative pipeline in Jenkins
This file contains hidden or 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
pipeline{ | |
agent { label 'master' } | |
parameters { | |
string(name: 'EMAIL_ID', defaultValue: '', description: 'Email ID') | |
} | |
options { | |
disableConcurrentBuilds() | |
buildDiscarder(logRotator(numToKeepStr: '10', daysToKeepStr: '5', artifactDaysToKeepStr: '4', articatNumToKeepStr: '4')) | |
} | |
stages{ | |
stage("Branch check"){ | |
steps{ | |
script{ | |
currentBuild.description="${EMAIL_ID}" | |
currentBuild.displayName="This is my ${EMAIL_ID}" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment