Skip to content

Commit

Permalink
Dont just use latest
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinPihony authored Oct 15, 2024
1 parent ddb6510 commit cd4e76f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ javaOptions in Universal ++= Seq(
"-Dpidfile.path=/dev/null"
)

lazy val gitSha: String = Process("git rev-parse --short HEAD").!!.trim
lazy val currentDate: String = new SimpleDateFormat("yyyyMMdd-HHmm").format(new Date())
lazy val uniqueTag: String = s"$currentDate-$gitSha"

packageName in Docker := name.value
version in Docker := "latest"
version in Docker := uniqueTag
dockerPermissionStrategy := DockerPermissionStrategy.Run
dockerRepository := sys.env.get("DOCKER_REPOSITORY").orElse(Some("docker.cloudsmith.io/lightbend/internal-registry"))
dockerCommands ++= Seq(
Expand All @@ -42,3 +46,5 @@ dockerCommands ++= Seq(
ExecCmd("RUN", "wget", "-o-", "https://downloads.mongodb.com/compass/mongodb-mongosh_1.10.6_amd64.deb"),
ExecCmd("RUN", "dpkg", "-i", "mongodb-mongosh_1.10.6_amd64.deb")
)

dockerAliases ++= Seq(dockerAlias.value.withTag(Option("latest")))

0 comments on commit cd4e76f

Please sign in to comment.