-
Notifications
You must be signed in to change notification settings - Fork 312
/
Copy pathpipeline-yt2.groovy
38 lines (38 loc) · 1.22 KB
/
pipeline-yt2.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
pipeline{
agent any
parameters {
string (name: "NAME" , description : 'please tell me your name?')
choice (name: "GENDER", choices: ['Male','Female'], description: 'choose gender')
}
tools{
maven "maven3"
}
stages {
stage ('printing name') {
steps {
script {
def name = "${params.NAME}"
def gender = "${params.GENDER}"
if (gender == "Male") {
echo "Mr.$name"
} else {
echo "Mrs.$name"
}
}
}
}
stage ("GIT CHECKOUT") {
steps {
echo "GIT CHECKOUT "
git credentialsId: 'Git-creds', url: 'https://github.com/Aj7Ay/sparkjava-war-example.git'
}
}
stage ("BUILD") {
steps {
script {
sh "mvn clean install package "
}
}
}
}
}