forked from hrdyq/DevOps-Pipeline-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
31 lines (29 loc) · 790 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
pipeline {
agent any
stages {
stage("code"){
steps{
git url: "https://github.com/hrdyq/DevOps-Pipeline-Project.git", branch: "master"
echo 'code cloned'
}
}
stage("build and test"){
steps{
sh "docker build -t devopsproject ."
echo 'code build successful'
}
}
stage("scan image"){
steps{
echo 'image scanning complete'
}
}
stage("deploy"){
steps{
sh "docker rm -f docker"
sh "docker run -d -p 8000:8000 --name docker devopsproject:latest"
echo 'deployment completed'
}
}
}
}