From 4b78c01aaa23433e0608d3232b92a956622c35e2 Mon Sep 17 00:00:00 2001 From: Andrew Davis <1709934+Savid@users.noreply.github.com> Date: Mon, 18 Mar 2024 12:03:44 +1000 Subject: [PATCH] fix(build): docker git ref (#6744) Signed-off-by: Andrew Davis <1709934+Savid@users.noreply.github.com> Co-authored-by: Sally MacFarlane Signed-off-by: amsmota --- build.gradle | 3 ++- ethereum/evmtool/build.gradle | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 9c98874597c..d9e854fd859 100644 --- a/build.gradle +++ b/build.gradle @@ -759,9 +759,10 @@ task distDocker { dockerPlatform = "--platform ${project.getProperty('docker-platform')}" println "Building for platform ${project.getProperty('docker-platform')}" } + def gitDetails = getGitCommitDetails(10) executable "sh" workingDir dockerBuildDir - args "-c", "docker build ${dockerPlatform} --build-arg BUILD_DATE=${buildTime()} --build-arg VERSION=${dockerBuildVersion} --build-arg VCS_REF=${getCheckedOutGitCommitHash()} -t ${image} ." + args "-c", "docker build ${dockerPlatform} --build-arg BUILD_DATE=${buildTime()} --build-arg VERSION=${dockerBuildVersion} --build-arg VCS_REF=${gitDetails.hash} -t ${image} ." } } diff --git a/ethereum/evmtool/build.gradle b/ethereum/evmtool/build.gradle index 5bc7877fc28..db582bcb02f 100644 --- a/ethereum/evmtool/build.gradle +++ b/ethereum/evmtool/build.gradle @@ -120,8 +120,9 @@ tasks.register('distDocker', Exec) { } } + def gitDetails = getGitCommitDetails(10) executable "sh" - args "-c", "docker build --build-arg BUILD_DATE=${buildTime()} --build-arg VERSION=${dockerBuildVersion} --build-arg VCS_REF=${getCheckedOutGitCommitHash()} -t ${image} ." + args "-c", "docker build --build-arg BUILD_DATE=${buildTime()} --build-arg VERSION=${dockerBuildVersion} --build-arg VCS_REF=${gitDetails.hash} -t ${image} ." } tasks.register('dockerUpload', Exec) {