-
Notifications
You must be signed in to change notification settings - Fork 548
Expand file tree
/
Copy pathjavaMaven.groovy
More file actions
54 lines (51 loc) · 1.47 KB
/
Copy pathjavaMaven.groovy
File metadata and controls
54 lines (51 loc) · 1.47 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
50
51
52
53
54
def call(Map pipelineParams) {
// this found at https://stackoverflow.com/a/49132694
def agentLabel = null
node {
stage('Checkout and set agent'){
checkout scm
agentLabel = getProperty(key:"agentLabel",file:"javaMaven.properties")
echo "found the agentLabel value of: ${agentLabel}"
}
}
pipeline {
agent { label "$agentLabel"}
stages {
stage("echo parameters") {
steps {
sh "env | sort"
}
}
stage("Prepare Build Environment") {
steps {
prepareBuildEnvironment()
helloWorld(name: "prepareBuildEnvironment")
helloWorldExternal()
}
}
stage("SonarQube Scan") {
when {
branch 'master'
}
steps {
echo 'scan'
}
}
stage("Build Application") {
steps {
sh "./mvnw clean install"
}
}
stage("Publish Artifacts") {
steps {
publishArtifacts(name: "publishArtifacts")
}
}
stage("Deploy Application") {
steps {
deployApplication(name: "deployApplication")
}
}
}
}
}