11node {
22 def app
3- def dep
43
54 stage(' Clone repository' ) {
65 checkout scm CI
76
8- sh ' docker volume create vol-in'
9- sh ' docker volume create vol-out'
10- sh ' docker volume ls'
7+ // sh 'docker volume create vol-in'
8+ // sh 'docker volume create vol-out'
9+ // sh 'docker volume ls'
1110
12- sh ' docker run -d --rm --name dummy -v vol-in:/vi alpine tail -f /dev/null'
13- sh ' docker cp . dummy:/vi'
14- sh ' docker stop dummy'
11+ // sh 'docker run -d --rm --name dummy -v vol-in:/vi alpine tail -f /dev/null'
12+ // sh 'docker cp . dummy:/vi'
13+ // sh 'docker stop dummy'
1514 }
1615
17- stage(' Dependencies ' ) {
18- checkout scm CI
16+ stage(' Dependency image ' ) {
17+ checkout scm CI
1918
20- dep = docker. build(" dependency-image" , " ./CI/dependency -v vol-in:/vi -v vol-out:/vo " )
19+ docker. build(" dependency-image" , " ./CI/dependencies " )
2120 }
2221
2322 stage(' Build image' ) {
24- /* This builds the actual image; synonymous to
25- * docker build on the command line */
26- sh ' ls -al CI'
27- // def dockerfile = 'build.dockerfile'
28- app = docker. build(" build-image" , " ./CI/build" )
23+ app = docker. build(" build-image" , " ./CI/build" )
2924 }
3025
3126 stage(' Test image' ) {
32- /* Ideally, we would run a test framework against our image.
33- * For this example, we're using a Volkswagen-type approach */
34-
3527 docker. build(" test-image" , " ./CI/test" )
3628 // app.inside {
3729 // sh 'echo "Tests passed"'
3830 // }
3931 }
4032
41- stage(' Push image' ) {
42- /* Finally, we'll push the image with two tags:
43- * First, the incremental build number from Jenkins
44- * Second, the 'latest' tag.
45- * Pushing multiple tags is cheap, as all the layers are reused. */
46- // docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') {
47- // app.push("${env.BUILD_NUMBER}")
48- // app.push("latest")
49- // }
33+ stage(' Deploy image' ) {
34+ docker. build(" deploy-image" , " ./CI/test" )
35+ }
36+
37+ stage(' Publish image' ) {
38+
5039 }
5140}
0 commit comments