Skip to content

Commit

Permalink
#23901 fixes the git hash resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
wezell committed Jan 25, 2023
1 parent 8fa9689 commit adc6806
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions dotCMS/build.gradle
Expand Up @@ -74,23 +74,26 @@ project.ext {
homeFolder = serverFolder + webAppRootFolder
dotcmsHome = serverFolder + webAppRootFolder




if (project.gradle.startParameter.taskNames.contains('deployWarTomcat') || project.gradle.startParameter.taskNames.contains('createDist')|| project.gradle.startParameter.taskNames.contains('docker')){
try {
git = Grgit.open(file('..'))
dotcmsReleaseBuild = git.head().abbreviatedId // abbreviatedId of head() method.
} catch (Exception ignored) {
println "ERROR:>> " + ignored.getMessage()
//Do nothing, this will fail only if git is not installed on this machine
}
try {
dotcmsReleaseBuild = getCheckedOutGitCommitHash()
println "SETTING BUILD TO:>> " + dotcmsReleaseBuild

} catch (Exception ignored) {
println "ERROR:>> " + ignored.getMessage()
//Do nothing, this will fail only if git is not installed on this machine
}


tomcatDistBase = "$distLocation/$tomcatDistInstallLocation-$tomcatInstallVersion"
dotcmsDistBase = "../$tomcatDistInstallLocation-$tomcatInstallVersion"
}

// this is way faster than Grgit
def getCheckedOutGitCommitHash() {
grgit.head().abbreviatedId
}



if (project.hasProperty('jarBaseName')) {
archivesBaseName = "$jarBaseName"
Expand Down

0 comments on commit adc6806

Please sign in to comment.