Skip to content
Snippets Groups Projects
Commit e7dafcb9 authored by User expired's avatar User expired
Browse files

not commiting changelogs in jenkins without changes :-)

parent 6d30abe1
No related branches found
No related tags found
No related merge requests found
......@@ -107,6 +107,9 @@ task changelog << {
}
fileChangelog.delete()
def nameUserCI = 'Jenkins'
def lastCommitByCI = false
def builder
def commits;
def numTags = tags.size()
......@@ -127,8 +130,12 @@ task changelog << {
}
}
if (commits != null && nameUserCI.equalsIgnoreCase(commits[0].committer.name)) {
lastCommitByCI = true
}
commits.grep { commit ->
!'jenkins'.equalsIgnoreCase(commit.committer.name)
!nameUserCI.equalsIgnoreCase(commit.committer.name)
}.inject(builder) { bldr, commit ->
bldr.append(' - ')
bldr.append(commit.shortMessage)
......@@ -139,7 +146,9 @@ task changelog << {
fileChangelog << builder.toString()
}
grgit.commit(message: 'Updating changelog', amend: false)
if (!lastCommitByCI) {
grgit.commit(message: 'Updating changelog', amend: false)
}
}
task vagrantExport(type: Zip) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment