forked from darinpope/github-api-global-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheasyPipeline.groovy
91 lines (89 loc) · 2.75 KB
/
easyPipeline.groovy
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
def call(String agentLabel,body) {
def pipelineParams= [:]
body.resolveStrategy = Closure.DELEGATE_FIRST
body.delegate = pipelineParams
body()
pipeline {
agent none
stages {
stage("echo parameters") {
agent { label "${agentLabel}" }
steps {
sh "env | sort"
echo "${agentLabel}"
echo "${pipelineParams.osConfiguration}"
echo "${pipelineParams.osConfiguration.OS_VERSION}"
echo "${pipelineParams.osConfiguration.DIR_TYPE}"
}
}
stage("Prepare Build Environment") {
agent { label "${agentLabel}" }
steps {
prepareBuildEnvironment()
helloWorld(name: "prepareBuildEnvironment")
helloWorldExternal()
}
}
stage("Source Code Checkout") {
agent { label "${agentLabel}" }
steps {
echo 'scc'
}
}
stage("SonarQube Scan") {
agent { label "${agentLabel}" }
when {
branch 'master'
}
steps {
echo 'scan'
}
}
stage("Build Application") {
agent { label "${agentLabel}" }
steps {
echo 'build'
}
}
stage("Publish Artifacts") {
agent { label "${agentLabel}" }
steps {
publishArtifacts(name: "publishArtifacts")
}
}
stage("Deploy Application") {
agent { label "${agentLabel}" }
steps {
deployApplication(name: "deployApplication")
}
}
//stage("Long Running Stage") {
// agent { label "${agentLabel}" }
// steps {
// script {
// hook = registerWebhook()
// }
// }
//}
//stage("Waiting for Webhook") {
// steps {
// echo "Waiting for POST to ${hook.getURL()}"
// script {
// data = waitForWebhook hook
// }
// echo "Webhook called with data: ${data}"
// }
//}
}
//post {
// always {
// sendNotification()
// }
//}
post {
always {
addSidebarLink()
}
}
}
}