-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathJenkinsfile
65 lines (60 loc) · 1.61 KB
/
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@Library("Shared") _
pipeline{
agent { label "dev"};
stages{
stage("Code Clone"){
steps{
script{
clone("https://github.com/LondheShubham153/two-tier-flask-app.git", "master")
}
}
}
stage("Trivy File System Scan"){
steps{
script{
trivy_fs()
}
}
}
stage("Build"){
steps{
sh "docker build -t two-tier-flask-app ."
}
}
stage("Test"){
steps{
echo "Developer / Tester tests likh ke dega..."
}
}
stage("Push to Docker Hub"){
steps{
script{
docker_push("dockerHubCreds","two-tier-flask-app")
}
}
}
stage("Deploy"){
steps{
sh "docker compose up -d --build flask-app"
}
}
}
post{
success{
script{
emailext from: '[email protected]',
to: '[email protected]',
body: 'Build success for Demo CICD App',
subject: 'Build success for Demo CICD App'
}
}
failure{
script{
emailext from: '[email protected]',
to: '[email protected]',
body: 'Build Failed for Demo CICD App',
subject: 'Build Failed for Demo CICD App'
}
}
}
}