From 299a0f3e9943b0d93c7a1704ed6d94e0aa097e1f Mon Sep 17 00:00:00 2001 From: Peixin Date: Tue, 10 Oct 2023 17:00:13 +0800 Subject: [PATCH] fix docker modified check in premerge (#1485) Signed-off-by: Peixin Li --- ci/Jenkinsfile.premerge | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ci/Jenkinsfile.premerge b/ci/Jenkinsfile.premerge index 8ae54f1781..72ef595a37 100644 --- a/ci/Jenkinsfile.premerge +++ b/ci/Jenkinsfile.premerge @@ -141,9 +141,10 @@ pipeline { container('cpu') { // check if pre-merge dockerfile modified def dockerfileModified = sh(returnStdout: true, - script: 'BASE=$(git --no-pager log --oneline -1 | awk \'{ print $NF }\'); ' + - 'git --no-pager diff --name-only HEAD $(git merge-base HEAD $BASE) ' + - "-- ${PREMERGE_DOCKERFILE} || true") +script: """BASE=\$(git --no-pager log --oneline -1 | awk \'{ print \$NF }\') +git --no-pager diff --name-only HEAD \$BASE -- ${PREMERGE_DOCKERFILE} || true""").trim() + echo "$dockerfileModified" + if (!dockerfileModified?.trim()) { TEMP_IMAGE_BUILD = false }