Using gitlabci to Release / Tag when it is on "no branch"

5 views
Skip to first unread message

jwa

unread,
Aug 24, 2016, 11:51:22 AM8/24/16
to GitLab
Hi All,

I have created a manual action at the end of my gitlabci pipeline that I call "release".

When this release target is invoked, I will spawn gradle to run the gradle-release plugin. This will
  • Remove the "-SNAPSHOT" qualified of the version in the root gradle.properties file
  • Commit the change to gradle.properties
  • Create a tag
  • Increment the version number and re-add a "-SNAPSHOT" qualifier to the gradle.properties
  • Commit gradle.properties
The gradle-release plugin is mightily upset, because it is not on a branch.

How can I have gitlabci tasks make changes to repository files, create tabs, etc. when there is no checked-out branch?

Any input would be greatly appreciated.

Drew Blessing

unread,
Aug 24, 2016, 5:00:49 PM8/24/16
to GitLab
GitLab checks out the specific commit SHA associated with the push. We don't know what state the branch might be in otherwise - someone else can push after you and we don't want to pull those changes in at subsequent stages. You *could* checkout out a specific branch as part of your release, do the commits, and push back to GitLab, but be careful you're not force pushing, because you could blow away changes others have pushed to the branch in the meantime. 
Reply all
Reply to author
Forward
0 new messages