File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,15 @@ pipeline {
44 stages {
55 stage(' Build' ) {
66 steps {
7- sh ' docker build -t ecommerce:latest .'
7+ sh ' docker build -t yamiannephilim/ecommerce:latest .'
8+ }
9+ }
10+
11+ stage(' Pushing' ) {
12+ steps {
13+ withDockerRegistry(credentialsId : ' dockerhub' , url : ' https://index.docker.io/v1/' ) {
14+ sh ' docker push yamiannephilim/springboot'
15+ }
816 }
917 }
1018
@@ -22,8 +30,17 @@ pipeline {
2230
2331 stage(' Run' ) {
2432 steps {
25- sh ' docker run --name ecommerce --network yan --restart=unless-stopped -d ecommerce:latest'
33+ sh ' docker container stop ecommerce || echo "this container does not exist"'
34+ sh ' docker network create yan || echo "this network exist"'
35+ sh ' echo y | docker container prune'
36+ sh ' docker run --name ecommerce --network yan --restart=unless-stopped -d yamiannephilim/ecommerce:latest'
2637 }
2738 }
2839 }
40+
41+ post {
42+ always {
43+ cleanWs()
44+ }
45+ }
2946}
You can’t perform that action at this time.
0 commit comments