This repository was archived by the owner on Mar 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.sbt
More file actions
executable file
·56 lines (39 loc) · 1.42 KB
/
build.sbt
File metadata and controls
executable file
·56 lines (39 loc) · 1.42 KB
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
import com.typesafe.sbt.packager.docker.{Cmd, ExecCmd}
name := """codacy-cppcheck"""
version := "1.0.0-SNAPSHOT"
val languageVersion = "2.11.8"
scalaVersion := languageVersion
resolvers ++= Seq(
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/releases",
"Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/"
)
libraryDependencies ++= Seq(
"com.typesafe.play" %% "play-json" % "2.4.6",
"com.codacy" %% "codacy-engine-scala-seed" % "2.6.33"
)
enablePlugins(JavaAppPackaging)
enablePlugins(DockerPlugin)
version in Docker := "1.0.0"
organization := "com.codacy"
mappings in Universal <++= (resourceDirectory in Compile) map { (resourceDir: File) =>
val src = resourceDir / "docs"
val dest = "/docs"
for {
path <- (src ***).get
if !path.isDirectory
} yield path -> path.toString.replaceFirst(src.toString, dest)
}
val dockerUser = "docker"
val dockerGroup = "docker"
daemonUser in Docker := dockerUser
daemonGroup in Docker := dockerGroup
dockerBaseImage := "rtfpessoa/ubuntu-jdk8-cppcheck"
dockerCommands := dockerCommands.value.flatMap {
case cmd@(Cmd("ADD", "opt /opt")) => List(cmd,
Cmd("RUN", "mv /opt/docker/docs /docs"),
Cmd("RUN", "groupadd -g 2004 docker"),
Cmd("RUN", "adduser --disabled-password --gecos \"\" --uid 2004 --gid 2004 docker"),
ExecCmd("RUN", Seq("chown", "-R", s"$dockerUser:$dockerGroup", "/docs"): _*)
)
case other => List(other)
}