Check for changes occurring
This commit is contained in:
parent
eaad6b8971
commit
522ec5c409
1 changed files with 6 additions and 1 deletions
|
|
@ -73,11 +73,14 @@ def getcomponentartifacts(info, String repofolder, String tempfolder) {
|
|||
def gitrelease(String releaserepo, String buildstamp, String dryrunpush) {
|
||||
summaryappend(" Git operations: ")
|
||||
dir(releaserepo) {
|
||||
def String precommitshacode = sh("git rev-parse --verify HEAD", returnStdout: true).trim()
|
||||
echo "Pre commit sha code: ${precommitshacode}"
|
||||
// Add anything new
|
||||
sh("git add .")
|
||||
summaryappend("Add,")
|
||||
// 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) {
|
||||
sh("git commit -a -m ${buildstamp}")
|
||||
summaryappend("Commit,")
|
||||
|
|
@ -85,6 +88,8 @@ def gitrelease(String releaserepo, String buildstamp, String dryrunpush) {
|
|||
else {
|
||||
summaryappend("No-commit,")
|
||||
}
|
||||
def String postcommitshacode = sh("git rev-parse --verify HEAD", returnStdout: true).trim()
|
||||
echo "Post commit sha code: ${precommitshacode}"
|
||||
// Tag with buildstamp
|
||||
sh("git tag ${buildstamp}")
|
||||
summaryappend("Tag (${buildstamp}),")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue