56 lines
1.3 KiB
Plaintext
56 lines
1.3 KiB
Plaintext
import hudson.plugins.accurev.*
|
|
|
|
def build_ok = true
|
|
|
|
pipeline {
|
|
agent any
|
|
|
|
parameters {
|
|
string(name: 'PERSON', defaultValue: 'Mr Jenkins', description: 'Who should I say hello to?')
|
|
|
|
text(name: 'BIOGRAPHY', defaultValue: '', description: 'Enter some information about the person')
|
|
|
|
booleanParam(name: 'api-test-1', defaultValue: true, description: 'API Test 1')
|
|
|
|
booleanParam(name: 'api-test-2', defaultValue: true, description: 'API Test 2')
|
|
|
|
choice(name: 'CHOICE', choices: ['One', 'Two', 'Three'], description: 'Pick something')
|
|
|
|
password(name: 'PASSWORD', defaultValue: 'SECRET', description: 'Enter a password')
|
|
}
|
|
|
|
stages {
|
|
stage('1') {
|
|
steps {
|
|
if (${params.apitest1}) {
|
|
echo "Teste 1"
|
|
}
|
|
|
|
sh 'exit 0'
|
|
}
|
|
}
|
|
|
|
stage('2') {
|
|
steps {
|
|
script {
|
|
try {
|
|
sh 'exit 0'
|
|
} finally {
|
|
echo "... finished"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('3') {
|
|
when {
|
|
expression {
|
|
return build_ok;
|
|
}
|
|
}
|
|
steps {
|
|
sh 'exit 0'
|
|
}
|
|
}
|
|
}
|
|
} |