forked from lucidsoftware/piezo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
67 lines (60 loc) · 2.4 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
import com.lucidchart.sbtcross.{Axis, CrossableProject, DefaultAxis}
import com.typesafe.sbt.packager.archetypes.ServerLoader
import play.api.libs.json.Json
val distributionAxis = new DefaultAxis {
def name = "dist"
def major(version: String) = version
}
lazy val admin = project.dependsOn(worker)
// there's probably a better way to also produce a Systemd deb
lazy val `admin-xenial` = admin.copy(id = "admin-xenial").settings(
serverLoading in Debian := ServerLoader.Systemd,
target := baseDirectory.value / "target-xenial"
)
lazy val worker = project
PgpKeys.pgpPassphrase in Global := Some(Array.emptyCharArray)
inThisBuild(Seq(
credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", System.getenv("SONATYPE_USERNAME"), System.getenv("SONATYPE_PASSWORD")),
developers ++= List(
Developer("disaacson", "Derrick Issacson", "", url("http://derrickisaacson.com/"))
),
licenses += "Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"),
homepage := Some(url("https://github.com/lucidsoftware/piezo")),
organization := "com.lucidchart",
scalaVersion := "2.11.8",
scmInfo := Some(ScmInfo(url("https://github.com/lucidsoftware/piezo"), "scm:git:[email protected]:lucidsoftware/piezo.git")),
version := sys.props.getOrElse("build.version", "0-SNAPSHOT")
))
val bintrayDescriptor = taskKey[File]("Descriptor for TravisCI release to Bintray")
bintrayDescriptor in (ThisBuild, Debian) := {
def files(deb: File, distribution: String) = Json.obj(
"includePattern" -> baseDirectory.value.toPath.relativize(deb.toPath.normalize).toString,
"matrixParams" -> Json.obj(
"deb_architecture" -> "amd64,i386",
"deb_component" -> "main",
"deb_distribution" -> distribution
),
"uploadPattern" -> s"pool/p/piezo-admin_${version.value}_${distribution}_all.deb"
)
val json = Json.obj(
"files" -> Json.arr(
files((packageBin in (admin, Debian)).value, "trusty"),
files((packageBin in (`admin-xenial`, Debian)).value, "xenial")
),
"package" -> Json.obj(
"name" -> "piezo",
"repo" -> "apt",
"subject" -> "lucidsoftware"
),
"publish" -> true,
"version" -> Json.obj(
"name" -> version.value,
"gpgSign" -> true,
"vcs_tag" -> version.value
)
)
val file = target.value / Debian.name / "bintray.json"
file.getParentFile.mkdirs()
IO.write(file, Json.prettyPrint(json))
file
}