From 4fa954d321c023d704e2517f77857344ec7738eb Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 13 Aug 2019 08:20:03 +0100 Subject: [PATCH 1/4] ci(jenkins): docker login is not required within the docker.image closure --- .ci/Jenkinsfile | 3 ++- .ci/linting.groovy | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 7be2d0aec..346e037c6 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -58,7 +58,8 @@ pipeline { script { docker.image('python:3.7-stretch').inside("-e PATH=${PATH}:${env.WORKSPACE}/bin"){ dir("${BASE_DIR}"){ - preCommit(commit: "${GIT_BASE_COMMIT}", junit: true) + // Let's disable the docker login within the docker.image closure. + preCommit(commit: "${GIT_BASE_COMMIT}", junit: true, registry: '') } } } diff --git a/.ci/linting.groovy b/.ci/linting.groovy index 270f9e75a..f0a1e4f7c 100644 --- a/.ci/linting.groovy +++ b/.ci/linting.groovy @@ -26,7 +26,8 @@ pipeline { script { def sha = getGitCommitSha() docker.image('python:3.7-stretch').inside("-e PATH=${PATH}:${env.WORKSPACE}/bin"){ - preCommit(commit: "${sha}", junit: true) + // Let's disable the docker login within the docker.image closure. + preCommit(commit: "${sha}", junit: true, registry: '') } } } From c05162705f7787358f109f1fc3d613cb8a7cebd6 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 13 Aug 2019 08:34:45 +0100 Subject: [PATCH 2/4] ci(jenkins): remove env variables --- .ci/Jenkinsfile | 4 ++-- .ci/linting.groovy | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 346e037c6..2b4913f68 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -56,8 +56,8 @@ pipeline { deleteDir() unstash 'source' script { - docker.image('python:3.7-stretch').inside("-e PATH=${PATH}:${env.WORKSPACE}/bin"){ - dir("${BASE_DIR}"){ + docker.image('python:3.7-stretch').inside { + dir(BASE_DIR){ // Let's disable the docker login within the docker.image closure. preCommit(commit: "${GIT_BASE_COMMIT}", junit: true, registry: '') } diff --git a/.ci/linting.groovy b/.ci/linting.groovy index f0a1e4f7c..aea30e2f5 100644 --- a/.ci/linting.groovy +++ b/.ci/linting.groovy @@ -25,7 +25,7 @@ pipeline { steps { script { def sha = getGitCommitSha() - docker.image('python:3.7-stretch').inside("-e PATH=${PATH}:${env.WORKSPACE}/bin"){ + docker.image('python:3.7-stretch').inside { // Let's disable the docker login within the docker.image closure. preCommit(commit: "${sha}", junit: true, registry: '') } From 6c2f1aae9bae5604c5b8bc8114f09e48d905d8f9 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 13 Aug 2019 08:51:39 +0100 Subject: [PATCH 3/4] Revert "ci(jenkins): remove env variables" This reverts commit c05162705f7787358f109f1fc3d613cb8a7cebd6. --- .ci/Jenkinsfile | 4 ++-- .ci/linting.groovy | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 2b4913f68..346e037c6 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -56,8 +56,8 @@ pipeline { deleteDir() unstash 'source' script { - docker.image('python:3.7-stretch').inside { - dir(BASE_DIR){ + docker.image('python:3.7-stretch').inside("-e PATH=${PATH}:${env.WORKSPACE}/bin"){ + dir("${BASE_DIR}"){ // Let's disable the docker login within the docker.image closure. preCommit(commit: "${GIT_BASE_COMMIT}", junit: true, registry: '') } diff --git a/.ci/linting.groovy b/.ci/linting.groovy index aea30e2f5..f0a1e4f7c 100644 --- a/.ci/linting.groovy +++ b/.ci/linting.groovy @@ -25,7 +25,7 @@ pipeline { steps { script { def sha = getGitCommitSha() - docker.image('python:3.7-stretch').inside { + docker.image('python:3.7-stretch').inside("-e PATH=${PATH}:${env.WORKSPACE}/bin"){ // Let's disable the docker login within the docker.image closure. preCommit(commit: "${sha}", junit: true, registry: '') } From d0eaa06b2d0e5ed86ab6b2632144bab09d0a1e62 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 13 Aug 2019 10:33:55 +0100 Subject: [PATCH 4/4] ci(jenkins): docker image is now managed within the preCommit step --- .ci/Jenkinsfile | 7 ++----- .ci/linting.groovy | 5 +---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 346e037c6..5d18fc0c1 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -56,11 +56,8 @@ pipeline { deleteDir() unstash 'source' script { - docker.image('python:3.7-stretch').inside("-e PATH=${PATH}:${env.WORKSPACE}/bin"){ - dir("${BASE_DIR}"){ - // Let's disable the docker login within the docker.image closure. - preCommit(commit: "${GIT_BASE_COMMIT}", junit: true, registry: '') - } + dir(BASE_DIR){ + preCommit(commit: "${GIT_BASE_COMMIT}", junit: true, dockerImage: 'python:3.7-stretch') } } } diff --git a/.ci/linting.groovy b/.ci/linting.groovy index f0a1e4f7c..4efe668c7 100644 --- a/.ci/linting.groovy +++ b/.ci/linting.groovy @@ -25,10 +25,7 @@ pipeline { steps { script { def sha = getGitCommitSha() - docker.image('python:3.7-stretch').inside("-e PATH=${PATH}:${env.WORKSPACE}/bin"){ - // Let's disable the docker login within the docker.image closure. - preCommit(commit: "${sha}", junit: true, registry: '') - } + preCommit(commit: "${sha}", junit: true, dockerImage: 'python:3.7-stretch') } } }