-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
26 lines (21 loc) · 878 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import groovy.json.JsonSlurper
@Library('pipeline-library-demo')_
node {
stage("stage 2") {
echo "We are at stage 2!"
}
stage('Fetch password details') {
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'ad2298b0-fe86-4f89-9810-62360cc19939',
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
println(env.USERNAME)
sh 'echo uname=$USERNAME pwd=$PASSWORD'
}
}
stage("create change order") {
def response = serviceNow_createChange serviceNowConfiguration: [instance: 'dev53461', producerId: '33a646a24f8113000216224f9310c723'], credentialsId:'5bff3281-3406-4583-ac11-df0adb43f6c9'
def jsonSlurper = new JsonSlurper()
def createResponse = jsonSlurper.parseText(response.content)
print 'createResponse' + createResponse
def changeNumber = createResponse.result.number
}
}