-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
110 lines (94 loc) · 3.94 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
ThisBuild / version := (version in ThisBuild).value
ThisBuild / scalaVersion := "2.11.8"
ThisBuild / organization := "io.arlas"
resolvers += "osgeo" at "http://download.osgeo.org/webdav/geotools/"
resolvers += "gisaia-ml" at s"https://dl.cloudsmith.io/${sys.env.getOrElse("CLOUDSMITH_PRIVATE_TOKEN", "basic")}/gisaia/private/maven"
resolvers += "boundless" at "http://repo.boundlessgeo.com/main"
resolvers += "jboss" at "https://repository.jboss.org/maven2/"
val sparkSQL = "org.apache.spark" %% "spark-sql" % "2.3.1" % "provided"
val sparkMLlib = "org.apache.spark" %% "spark-mllib" % "2.3.1" % "provided"
val spark = Seq(sparkSQL,sparkMLlib)
val sparkCassandraConnector = "com.datastax.spark" %% "spark-cassandra-connector" % "2.3.2" % "provided"
val cassandra = Seq(sparkCassandraConnector)
val scalaTest = "org.scalatest" %% "scalatest" % "2.2.5"
val elasticSearch = "org.elasticsearch" %% "elasticsearch-spark-20" % "6.4.0" % "provided"
val elastic = Seq(elasticSearch)
val gtReferencing = "org.geotools" % "gt-referencing" % "20.1" % "provided"
val gtGeometry = "org.geotools" % "gt-geometry" % "20.1" % "provided"
val geotools = Seq(gtReferencing, gtGeometry)
val arlasMl = "io.arlas" %% "arlas-ml" % "0.1.1"
val arlas = Seq(arlasMl)
lazy val arlasProc = (project in file("."))
.settings(
name := "arlas-proc",
libraryDependencies ++= spark,
libraryDependencies ++= cassandra,
libraryDependencies ++= elastic,
libraryDependencies ++= geotools,
libraryDependencies ++= arlas,
libraryDependencies += scalaTest % Test
)
//publish to external repo
ThisBuild / publishTo := { Some("Cloudsmith API" at "https://maven.cloudsmith.io/gisaia/private/") }
ThisBuild / pomIncludeRepository := { x => false }
ThisBuild / credentials += Credentials("Cloudsmith API", "maven.cloudsmith.io", sys.env.getOrElse("CLOUDSMITH_USER", ""), sys.env.getOrElse("CLOUDSMITH_API_KEY", ""))
//publish also assembly jar
test in assembly := {}
lazy val arlasProcAssembly = project
.dependsOn(arlasProc)
.settings(
publishArtifact in (Compile, packageBin) := false,
publishArtifact in (Compile, packageDoc) := false,
publishArtifact in (Compile, packageSrc) := false,
name := "arlas-proc-assembly",
artifact in (Compile, assembly) ~= { art =>
art.withClassifier(Some("assembly"))
},
addArtifact(artifact in (Compile, assembly), assembly)
)
//sbt-release
import ReleaseTransformations._
import ReleasePlugin.autoImport._
import sbtrelease.{Git, Utilities}
import Utilities._
val deployBranch = "master"
def merge: (State) => State = { st: State =>
val git = st.extract.get(releaseVcs).get.asInstanceOf[Git]
//TODO manage git redirecting with no reason to stderr
git.cmd("status") ! st.log
val curBranch = (git.cmd("rev-parse", "--abbrev-ref", "HEAD") !!).trim
st.log.info(s"####### current branch: $curBranch")
git.cmd("checkout", deployBranch) ! st.log
st.log.info(s"####### pull $deployBranch")
git.cmd("pull") ! st.log
st.log.info(s"####### merge")
git.cmd("merge", curBranch, "--no-ff", "--no-edit") ! st.log
st.log.info(s"####### push")
git.cmd("push", "origin", s"$deployBranch:$deployBranch") ! st.log
st.log.info(s"####### checkout $curBranch")
git.cmd("checkout", curBranch) ! st.log
st.log.info(s"####### pull $curBranch")
git.cmd("pull", "origin", curBranch) ! st.log
st.log.info(s"####### rebase origin/$deployBranch")
git.cmd("rebase", s"origin/${deployBranch}") ! st.log
st
}
lazy val mergeReleaseVersionAction = { st: State =>
val newState = merge(st)
newState
}
val mergeReleaseVersion = ReleaseStep(mergeReleaseVersionAction)
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
pushChanges, //to make sure develop branch is pulled
tagRelease,
mergeReleaseVersion, //will merge into master and push
setNextVersion,
commitNextVersion,
pushChanges
)