Check for changes occurring

This commit is contained in:
Dan Hawkins 2018-11-30 11:07:08 +00:00
commit 4e140fe10a

View file

@ -73,11 +73,14 @@ def getcomponentartifacts(info, String repofolder, String tempfolder) {
def gitrelease(String releaserepo, String buildstamp, String dryrunpush) { def gitrelease(String releaserepo, String buildstamp, String dryrunpush) {
summaryappend(" Git operations: ") summaryappend(" Git operations: ")
dir(releaserepo) { dir(releaserepo) {
def String precommitshacode = sh("git rev-parse --verify HEAD", returnStdout: true).trim()
echo "Pre commit sha code: ${precommitshacode}"
// Add anything new // Add anything new
sh("git add .") sh("git add .")
summaryappend("Add,") summaryappend("Add,")
// Perform git commit (if necessary) // Perform git commit (if necessary)
def changesoccurred = sh(script: "git status --porcelain", returnStdout: true) def changes = sh(script: "git status --porcelain", returnStdout: true)
boolean changesoccurred = changes?.trim()
if (changesoccurred) { if (changesoccurred) {
sh("git commit -a -m ${buildstamp}") sh("git commit -a -m ${buildstamp}")
summaryappend("Commit,") summaryappend("Commit,")
@ -85,6 +88,8 @@ def gitrelease(String releaserepo, String buildstamp, String dryrunpush) {
else { else {
summaryappend("No-commit,") summaryappend("No-commit,")
} }
def String postcommitshacode = sh("git rev-parse --verify HEAD", returnStdout: true).trim()
echo "Post commit sha code: ${precommitshacode}"
// Tag with buildstamp // Tag with buildstamp
sh("git tag ${buildstamp}") sh("git tag ${buildstamp}")
summaryappend("Tag (${buildstamp}),") summaryappend("Tag (${buildstamp}),")