Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Play 2 Framework , how can I include git commit sha in sbt dist package name?

I have a Play 2.2.x project, for which I can create universal distribution zip archive:

$ sbt dist

This creates a file target/universal/project-name-1.0-SHAPSHOT.zip

I want to include a git commit sha such that the package generated looks like this:

target/universal/project-name-1.0-SHAPSHOT-0d6d7f4325de87df6a8f46bd635d14ba8892715a.zip

In Play 2 Framework , how can I include git commit sha in sbt dist package name?

like image 980
tuxdna Avatar asked Dec 08 '22 06:12

tuxdna


1 Answers

Easiest way is:

version := "1.0-SNAPSHOT-" + "git rev-parse HEAD".!!.trim
like image 109
James Roper Avatar answered May 10 '23 22:05

James Roper