Skip to content

Commit

Permalink
change build logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Dert1129 committed Apr 23, 2024
1 parent 5307f7c commit cd3986b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ task unpack(type: Copy) {
into("build/dependency")
}

def getTagInfo() {
if (project.hasProperty('tag')) {
def tagValue = project.property('tag')
return tagValue
} else {
def gitBranch = "Unknown branch"
def getCurrentGitBranch() {
if (project.hasProperty('tag')) {
def tagValue = project.property('tag')
return tagValue
} else {
def gitBranch = "Unknown branch"
try {
def workingDir = new File("${project.projectDir}")
def result = 'git rev-parse --abbrev-ref HEAD'.execute(null, workingDir)
Expand All @@ -71,17 +71,16 @@ def getTagInfo() {
}
} catch (e) {
}
if (gitBranch == "develop" || gitBranch == "master"){
return "${jar.version}"
if (gitBranch == "develop" || gitBranch == "master"){
return project.version
}else{
return gitBranch
}
return gitBranch
}
}

docker {
name "kingstonduo/cassiopeia-data:" + getTagInfo()
name "${project.group}/cassiopeia-data:" + getCurrentGitBranch()
copySpec.from(tasks.unpack.outputs).into("dependency")
buildArgs(['DEPENDENCY': "dependency"])
}

0 comments on commit cd3986b

Please sign in to comment.