Commit d24c730 1 parent a2c676c commit d24c730 Copy full SHA for d24c730
File tree 1 file changed +10
-13
lines changed
1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change
1
+ @Library (" Shared" ) _
1
2
pipeline{
2
3
3
4
agent { label " dev" };
4
5
5
6
stages{
6
7
stage(" Code Clone" ){
7
8
steps{
8
- git url : " https://github.com/LondheShubham153/two-tier-flask-app.git" , branch : " master"
9
+ script{
10
+ clone(" https://github.com/LondheShubham153/two-tier-flask-app.git" , " master" )
11
+ }
9
12
}
10
13
}
11
14
stage(" Trivy File System Scan" ){
12
15
steps{
13
- sh " trivy fs . -o results.json"
16
+ script{
17
+ trivy_fs()
18
+ }
14
19
}
15
20
}
16
21
stage(" Build" ){
@@ -27,17 +32,9 @@ pipeline{
27
32
}
28
33
stage(" Push to Docker Hub" ){
29
34
steps{
30
- withCredentials([usernamePassword(
31
- credentialsId :" dockerHubCreds" ,
32
- passwordVariable : " dockerHubPass" ,
33
- usernameVariable : " dockerHubUser"
34
- )]){
35
-
36
- sh " docker login -u ${ env.dockerHubUser} -p ${ env.dockerHubPass} "
37
- sh " docker image tag two-tier-flask-app ${ env.dockerHubUser} /two-tier-flask-app"
38
- sh " docker push ${ env.dockerHubUser} /two-tier-flask-app:latest"
39
-
40
- }
35
+ script{
36
+ docker_push(" dockerHubCreds" ," two-tier-flask-app" )
37
+ }
41
38
}
42
39
}
43
40
stage(" Deploy" ){
You can’t perform that action at this time.
0 commit comments