diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 5d18fc0c1..06794a88c 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -47,8 +47,9 @@ pipeline { stage('Sanity checks') { when { beforeAgent true - not { - changeRequest() + anyOf { + not { changeRequest() } + expression { return params.Run_As_Master_Branch } } } steps { @@ -56,8 +57,11 @@ pipeline { deleteDir() unstash 'source' script { - dir(BASE_DIR){ - preCommit(commit: "${GIT_BASE_COMMIT}", junit: true, dockerImage: 'python:3.7-stretch') + docker.image('python:3.7-stretch').inside("-e PATH=${PATH}:${env.WORKSPACE}/bin"){ + dir("${BASE_DIR}"){ + // registry: '' will help to disable the docker login + preCommit(commit: "${GIT_BASE_COMMIT}", junit: true, registry: '') + } } } } diff --git a/.ci/linting.groovy b/.ci/linting.groovy index 4efe668c7..3dabe46e6 100644 --- a/.ci/linting.groovy +++ b/.ci/linting.groovy @@ -25,7 +25,10 @@ pipeline { steps { script { def sha = getGitCommitSha() - preCommit(commit: "${sha}", junit: true, dockerImage: 'python:3.7-stretch') + docker.image('python:3.7-stretch').inside("-e PATH=${PATH}:${env.WORKSPACE}/bin"){ + // registry: '' will help to disable the docker login + preCommit(commit: "${sha}", junit: true, registry: '') + } } } } diff --git a/Jenkinsfile b/Jenkinsfile index c5946fae2..4df6d9893 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,8 +61,9 @@ pipeline { stage('Sanity checks') { when { beforeAgent true - not { - changeRequest() + anyOf { + not { changeRequest() } + expression { return params.Run_As_Master_Branch } } } steps { @@ -70,8 +71,11 @@ pipeline { deleteDir() unstash 'source' script { - dir(BASE_DIR){ - preCommit(commit: "${GIT_BASE_COMMIT}", junit: true, dockerImage: 'python:3.7-stretch') + docker.image('python:3.7-stretch').inside("-e PATH=${PATH}:${env.WORKSPACE}/bin"){ + dir("${BASE_DIR}"){ + // registry: '' will help to disable the docker login + preCommit(commit: "${GIT_BASE_COMMIT}", junit: true, registry: '') + } } } }