-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathJenkinsfile-declarative
65 lines (65 loc) · 1.11 KB
/
Jenkinsfile-declarative
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
@Library('shared-starter') _
pipeline {
agent any
stages {
stage("Prepare Build Environment") {
steps {
prepareBuildEnvironment()
helloWorld(name: "prepareBuildEnvironment")
helloWorldExternal()
}
}
stage("Source Code Checkout") {
steps {
echo 'scc'
}
}
stage("Only Even Build Number") {
when { expression { return evenOdd() == true }}
steps {
echo "the build number is even ${env.BUILD_NUMBER}"
}
}
stage("SonarQube Scan") {
when {
branch 'Development'
}
steps {
echo 'scan'
}
}
stage("Build Application") {
steps {
echo 'build'
}
}
stage("Stash") {
when { not { branch 'master' }}
steps {
stash(name:"${env.BUILD_JOB}")
}
}
stage("Publish Artifacts") {
steps {
publishArtifacts(name: "publishArtifacts")
}
}
stage("Deploy Application") {
steps {
deployApplication(name: "deployApplication")
}
}
stage("Unstash") {
when { not { branch 'master' }}
steps {
unstash(name:"${env.BUILD_JOB}")
echo "foobar"
}
}
}
post {
always {
sendNotification()
}
}
}