Jenkins: Push to public Docker registry
authorpeusterm <manuel.peuster@uni-paderborn.de>
Tue, 19 Sep 2017 09:39:53 +0000 (11:39 +0200)
committerpeusterm <manuel.peuster@uni-paderborn.de>
Tue, 19 Sep 2017 09:39:53 +0000 (11:39 +0200)
Signed-off-by: peusterm <manuel.peuster@uni-paderborn.de>
Jenkinsfile

index 8ac8efe..0f6d50a 100644 (file)
@@ -12,19 +12,22 @@ pipeline {
         stage('Build') {
             steps {
                 echo 'Building...'
-                sh "docker build -t test-son-emu-img ."
+                sh "docker build -t sonatanfv/son-emu:dev ."
             }
         }
         stage('Test') {
             steps {
                 echo 'Testing...'
-                sh "docker run --name son-emu --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock test-son-emu-img 'py.test -v src/emuvim/test/unittests'"
+                sh "docker run --name son-emu --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock sonatanfv/son-emu:dev 'py.test -v src/emuvim/test/unittests'"
             }
         }
         stage('Package') {
             steps {
                 echo 'Packaging (Docker-image)...'
-                sh "docker tag test-son-emu-img:latest registry.sonata-nfv.eu:5000/son-emu:latest"
+                // push to public Docker registry
+                sh "docker push sonatanfv/son-emu:dev"
+                // push to internal Docker registry
+                sh "docker tag sonatanfv/son-emu:dev registry.sonata-nfv.eu:5000/son-emu:latest"
                 sh "docker push registry.sonata-nfv.eu:5000/son-emu"        
             }
         }