What sbt plugins are available for frequent (several times a day) project releases from git?

There are about 5 scala projects in our launch, for which we often need to push updates to production. Due to our fast pace, I quickly discovered that the sbt release plugin has too much overhead and thus pops SNAPSHOTS throughout the day. We have a build server (Jenkins) in the cloud, which can also be used to generate releases, but even this slows us down.

Are there any good plugins that can do something, like grab the hash code and git checkout and the user who (along with the date) as the version?

+4
source share
2 answers

Thanks to the sbt Process API, you really need very little to include the git hash in your version:

version in ThisBuild := "1.0-" + Process("git rev-parse HEAD").lines.head 

Use git rev-parse --short HEAD for a short version of the git hash.

Of course, for better reuse, you can move the Process part to your own setup and just do something like:

 version in ThisBuild <<= gitSha("1.0-" + _) 
+4
source

tl; dr Use the sbt-git plugin.

Make enablePlugins(GitVersioning) in the build.sbt module and start auto- build.sbt your version using the plugin.

+2
source

Source: https://habr.com/ru/post/1486082/


All Articles