2 Star 6 Fork 4

devops-ws / learn-pipeline-java

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
Jenkinsfile-parameters.groovy 738 Bytes
Copy Edit Raw Blame History
Rick authored 2019-09-29 14:09 . Add Jenkinsfile with parameters (#9)
pipeline {
agent any
parameters {
string defaultValue: 'rick', description: 'just for testing', name: 'name', trim: true
booleanParam defaultValue: false, description: 'You can use this flag to debug your Pipeline', name: 'debug'
}
stages{
stage('simple'){
steps{
echo "My name is ${params.name}."
script {
if ("${params.debug}" == "true") {
echo "You can put some debug info at here."
echo "Another way to use param: " + params.name
}
}
}
}
stage('debug stage') {
when {
equals expected: true, actual: params.debug
}
steps {
echo "It's joke, there're debug info here."
}
}
}
}
Groovy
1
https://gitee.com/devops-workspace/learn-pipeline-java.git
git@gitee.com:devops-workspace/learn-pipeline-java.git
devops-workspace
learn-pipeline-java
learn-pipeline-java
master

Search

53164aa7 5694891 3bd8fe86 5694891