Skip to content

Support of git push -o options #516

@giorgioinf

Description

@giorgioinf

I would like to recommend a new feature for the release process.

Some git services like gitlab accept git push options to customize their behavior.

I my case, I'd like to skip the gitlab-ci triggering other pipeline during the release process.

Currently it's done via git commit messages, example:

releaseTagComment := s"[ci skip] ${releaseTagComment.value}",
releaseCommitMessage := s"[ci skip] ${releaseCommitMessage.value}",
releaseNextCommitMessage := s"[ci skip] ${releaseNextCommitMessage.value}",

This approach works, but it could be even better without messing up with the commit messages.

As a suggestion:

releasePushCurrentBranchOptions := Seq("ci.skip"), 
releasePushTagsOptions := Seq("ci.skip"),

releasePushOptions := Seq("ci.skip"), # alternative for both above

This would modify the Vcs.scala codes, to something like:

private def pushCurrentBranch = {
    val localBranch = currentBranch
    val options = releasePushCurrentBranchOptions
    cmd(("push" +: options.flatMap(Seq("-o", _)) :+ trackingRemote :+ "%s:%s".format (localBranch, trackingBranch)): _*)
    //cmd("push", trackingRemote, "%s:%s" format (localBranch, trackingBranch))
 }

private def pushTags = {
    val options = releasePushTagsOptions
    cmd(("push" +: options.flatMap(Seq("-o", _)) :+ "--tags" :+ trackingRemote): _*)
    //cmd("push", "--tags", trackingRemote)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions