Check for changes occurring
This commit is contained in:
parent
e4f8dab2bb
commit
4e140fe10a
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) {
|
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}),")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue