diff --git a/Jenkinsfile b/Jenkinsfile index 020f842003ed0ab091bd6d5909b4f619c5c40aff..f20853c31d3aee9fb685c2c79cffee238a22e236 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -169,19 +169,6 @@ pipeline { 'known_hosts" build/docs/. ' + '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 { } } } + // ********************* 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 ************************************ stage('Post') { agent { label "master"}