Skip to content

Instantly share code, notes, and snippets.

@devopsblog
Last active January 16, 2021 04:44
Show Gist options
  • Save devopsblog/7b67cddcf9902e39a1ac55f42b930010 to your computer and use it in GitHub Desktop.
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
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