-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
51 lines (51 loc) · 951 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
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
pipeline{
agent any
tools{
jdk 'java8'
maven 'maven'
}
environment{
SERVER_CRED=credentials('server-cred')
}
parameters{
string(name: 'Branch',defaultValue: 'main',description: 'please type branch')
choice(name: 'Version',choices: ['1.2.0','1.2.1','1.2.2'],description: 'select version')
booleanParam(name: 'executeTests',defaultValue: true,description: 'test')
}
stages{
stage("init"){
steps{
script{
gv=load "script.groovy"
}
}
}
stage("build"){
steps{
script{
gv.buildApp()
}
}
}
stage("test"){
when{
expression{params.executeTests}
}
steps{
script{
gv.testApp()
}
}
}
stage("deploy"){
when{
expression{params.Version=='1.2.0'}
}
steps{
script{
gv.deployApp()
}
}
}
}
}