Skip to content
Snippets Groups Projects
Commit 0fedb434 authored by Lars Bilke's avatar Lars Bilke
Browse files

[Jenkins] Move push docker images to own subjob.

Docker in Docker is not possible with our current images.
Reverted back to previous setup.
parent 2e3e156f
No related branches found
No related tags found
No related merge requests found
...@@ -169,19 +169,6 @@ pipeline { ...@@ -169,19 +169,6 @@ pipeline {
'known_hosts" build/docs/. ' + 'known_hosts" build/docs/. ' +
'www-data@jenkins:/var/www/doxygen.opengeosys.org' 'www-data@jenkins:/var/www/doxygen.opengeosys.org'
} }
// Push Docker Images
dir('scripts/docker') {
def gccImage = docker.build("ogs6/gcc:latest", "-f Dockerfile.gcc.full .")
def gccGuiImage = docker.build("ogs6/gcc:gui", "-f Dockerfile.gcc.gui .")
def clangImage = docker.build("ogs6/clang:latest", "-f Dockerfile.clang.full .")
withCredentials([usernamePassword(credentialsId: 'docker-hub-credentials',
passwordVariable: 'pw', usernameVariable: 'docker_user')]) {
sh 'echo $pw | docker login -u $docker_user --password-stdin'
gccImage.push()
gccGuiImage.push()
clangImage.push()
}
}
} }
} }
} }
...@@ -681,6 +668,30 @@ pipeline { ...@@ -681,6 +668,30 @@ pipeline {
} }
} }
} }
// ********************* Push Docker Images ***************************
stage('Push Docker Images') {
when {
beforeAgent true
environment name: 'JOB_NAME', value: 'ufz/ogs/master'
}
agent { label 'docker'}
steps {
script {
dir('scripts/docker') {
def gccImage = docker.build("ogs6/gcc:latest", "-f Dockerfile.gcc.full .")
def gccGuiImage = docker.build("ogs6/gcc:gui", "-f Dockerfile.gcc.gui .")
def clangImage = docker.build("ogs6/clang:latest", "-f Dockerfile.clang.full .")
withCredentials([usernamePassword(credentialsId: 'docker-hub-credentials',
passwordVariable: 'pw', usernameVariable: 'docker_user')]) {
sh 'echo $pw | docker login -u $docker_user --password-stdin'
gccImage.push()
gccGuiImage.push()
clangImage.push()
}
}
}
}
}
// *************************** Post ************************************ // *************************** Post ************************************
stage('Post') { stage('Post') {
agent { label "master"} agent { label "master"}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment