forked from Sonal0409/DevOpsClassCodes
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Jenkinsfile2
46 lines (45 loc) · 1.14 KB
/
Jenkinsfile2
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
def sample_array = ["Akshat", "John", "Aman"]
pipeline{
environment{
git = "https://github.com/akshu20791/DevOpsClassCodes/"
compile = "mvn compile"
FNAME = "Akshat_global"
}
agent any
stages{
stage('checkout the code from github'){
environment{
FNAME = "Akshat_local"
}
steps{
git url: "${git}"
echo 'github url checkout'
sh 'echo ${FNAME}'
echo "${sample_array[0]}"
}
}
stage('codecompile with akshat'){
steps{
echo 'starting compiling'
sh '${compile}'
sh 'echo ${FNAME}'
}
}
stage('codetesting with akshat'){
steps{
sh 'mvn test'
}
}
stage('qa with akshat'){
steps{
sh 'mvn checkstyle:checkstyle'
recordIssues sourceCodeRetention: 'LAST_BUILD', tools: [checkStyle()]
}
}
stage('package with akshat'){
steps{
sh 'mvn package'
}
}
}
}