Skip to content

Commit

Permalink
eventDeploy gradle task
Browse files Browse the repository at this point in the history
  • Loading branch information
manthan-acharya committed Jan 25, 2024
1 parent 325f2fe commit b0934ff
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,31 @@ gversion {
indent = " "
}

tasks.register('eventDeploy') {
dependsOn('deploy')
doFirst {
def branchPrefix = "event"

def branch = 'git branch --show-current'.execute().text.trim()
if (!branch.startsWith(branchPrefix)) {
throw new GradleException("Current branch '$branch' is not a valid event branch.")
}

def commitMessage = "Update at '${new Date().toString()}'"

exec {
commandLine 'git', 'add', '-A'
commandLine 'git', 'commit', '-m', commitMessage
}

//'git add -A'.execute()
// commandLine 'git', 'add', '-A'

println "Deployed to branch: '$branch'"
println "Commit message: '$commitMessage'"
}
}

// Spotless formatting
project.compileJava.dependsOn(spotlessApply)
spotless {
Expand Down

0 comments on commit b0934ff

Please sign in to comment.