If you also use Gradle for your collections, there is a Git plugin for it.
Here is the complete build.gradle :
buildscript { repositories { mavenCentral() } dependencies { classpath "org.ajoberstar:gradle-git:0.6.3" } } import org.ajoberstar.gradle.git.tasks.* task tag(type: GitTag) { tagName = version message = "Release of $version" } task pushWithTags(type: GitPush){ credentials{ username = "karim" password = gitPassword } setPushTags(true) } task add(type: GitAdd){ include("yourVersionFile.txt") // or add everything with include("*") } task commit(type: GitCommit){ setMessage(commitMsg) } task pushNewVersion(){ tasks.add.execute() tasks.commit.execute() tasks.tag.execute() tasks.pushWithTags.execute() }
This is how you add, put, commit and click using a script (there is a plugin to execute this from in Jenkins):
gradle pushNewVersion "-PcommitMsg=hi" "-Pversion=0.1.1" "-PgitPassword=secret"
source share