forked from ssahoo81/samplejava
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathJenkinsfile
More file actions
49 lines (47 loc) · 1.29 KB
/
Copy pathJenkinsfile
File metadata and controls
49 lines (47 loc) · 1.29 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
pipeline {
agent any
//options {
//disableResume()
//}
stages {
stage('build') {
steps {
echo 'build …'
//curlCall()
snDevOpsStep()
snDevOpsChange()
}
}
stage('test') {
steps {
echo 'test …'
//snDevOpsStep()
snDevOpsChange()
}
}
stage('Deploy for development') {
when {
branch 'development'
}
steps {
snDevOpsStep()
}
}
stage('Deploy for production') {
when {
branch 'production'
}
steps {
snDevOpsStep()
}
}
}
}
def curlCall(){
def jsonObj = [: ]
def json = new groovy.json.JsonBuilder(jsonObj)
def response = ["curl", "-k", "-X", "POST", "-H", "Content-Type: application/json", "-d", "", "http://devops.integration.user:devops@127.0.0.1:8082/api/sn_devops/v1/devops/tool/orchestration?toolType=jenkins&toolId=36a4417dc76120108c2c02b827c260b9"].execute()
response.waitFor()
println response.err.text
println response.text
}