forked from vikash-kumar01/mrdevops_java_app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsFile
More file actions
76 lines (65 loc) · 2.03 KB
/
JenkinsFile
File metadata and controls
76 lines (65 loc) · 2.03 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@Library('library') _
pipeline {
agent any
parameters {
choice choices: ['create', 'deny'], description: 'choose one', name: 'action'
}
stages {
stage('Build') {
when{ expression { params.action == 'create'} }
steps {
git branch: 'main',
credentialsId: 'yourCredentialsId', // Add your credentials ID
url: 'https://github.com/shashankmcode/mrdevops_java_app.git'
}
}
stage('maven test') { // Rename the stage to avoid conflicts
when{ expression { params.action == 'create'} }
steps {
script {
test1()
}
}
}
stage('Staticcode Analysis') { // Rename the stage to avoid conflicts
when{ expression { params.action == 'create'} }
steps {
script {
staticcodeanalysis()
}
}
}
stage('QualityGate Analyssis') { // Rename the stage to avoid conflicts
when{ expression { params.action == 'create'} }
steps {
script {
qualitycode()
}
}
}
stage('MavenBuild') { // Rename the stage to avoid conflicts
when{ expression { params.action == 'create'} }
steps {
script {
appbuild()
}
}
}
stage('Dockerbuild image') { // Rename the stage to avoid conflicts
when{ expression { params.action == 'create'} }
steps {
script {
imagebuild()
}
}
}
stage('Image scan using Trivy') { // Rename the stage to avoid conflicts
when{ expression { params.action == 'create'} }
steps {
script {
trivy()
}
}
}
}
}