forked from bennetimo/shrinkwrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
81 lines (73 loc) · 2.87 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import sbt.Keys.scalaVersion
import sbtassembly.AssemblyPlugin.autoImport.assemblyJarName
import ReleaseTransformations._
ThisBuild / scalaVersion := "2.12.7"
ThisBuild / organization := "io.coderunner"
scalacOptions := Seq("-unchecked", "-deprecation", "-feature")
enablePlugins(DockerPlugin)
lazy val publishDocker = ReleaseStep(action = st => {
val extracted = Project.extract(st)
val ref: ProjectRef = extracted.get(thisProjectRef)
extracted.runAggregated(
sbtdocker.DockerKeys.dockerBuildAndPush in sbtdocker.DockerPlugin.autoImport.docker in ref,
st)
st
})
lazy val shrinkwrap = (project in file("."))
.enablePlugins(BuildInfoPlugin)
.settings(
name := "shrinkwrap",
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "build",
scalafmtOnCompile := true,
libraryDependencies += "com.github.scopt" %% "scopt" % "3.7.0",
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3",
libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.9.0",
libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.5",
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.5" % "test",
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.14.0" % "test",
libraryDependencies += "org.mockito" %% "mockito-scala" % "1.0.0" % Test,
assemblyJarName in assembly := s"shrinkwrap-${version.value}.jar",
dockerfile in docker := {
val artifact: File = assembly.value
val artifactTargetPath = s"/app/${artifact.name}"
val dockerDir = target.value / "docker"
val projectDir = project.base.getAbsolutePath
val dockerFile = new Dockerfile {
from(" jrottenberg/ffmpeg:4.0-alpine")
.maintainer("Tim Bennett")
.runRaw("apk --update --no-cache add openjdk8-jre exiftool bash")
.add(artifact, artifactTargetPath)
.entryPoint("java", "-jar", artifactTargetPath)
}
dockerFile
},
imageNames in docker := Seq(
// Sets the latest tag
ImageName(
namespace = Some("bennetimo"),
repository = name.value,
tag = Some("latest")
),
// Sets a name with a tag that contains the project version
ImageName(
namespace = Some("bennetimo"),
repository = name.value,
tag = Some(version.value)
)
),
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
//publishArtifacts,
publishDocker,
setNextVersion,
commitNextVersion,
pushChanges
)
)