Skip to content

Commit

Permalink
Setup Cognite fork release
Browse files Browse the repository at this point in the history
  • Loading branch information
Tapped committed Aug 1, 2019
1 parent ad01f94 commit 9c526a2
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 11 deletions.
37 changes: 37 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
def label = "fs2-grpc-${UUID.randomUUID().toString().substring(0, 5)}"

podTemplate(label: label,
containers: [containerTemplate(name: 'sbt',
image: 'eu.gcr.io/cognitedata/openjdk8-sbt:2018-06-22-c73da5c',
resourceRequestCpu: '100m',
resourceLimitCpu: '2000m',
resourceRequestMemory: '3000Mi',
resourceLimitMemory: '3000Mi',
ttyEnabled: true,
command: '/bin/cat -')],
volumes: [secretVolume(secretName: 'sbt-credentials', mountPath: '/sbt-credentials'),
secretVolume(secretName: 'jenkins-docker-builder', mountPath: '/jenkins-docker-builder')]) {

node(label) {
container('jnlp') {
stage('Checkout') {
checkout(scm)
}
}
container('sbt') {
stage('Install SBT config') {
sh('mkdir -p /root/.sbt/1.0 && cp /sbt-credentials/credentials.sbt /root/.sbt/1.0/credentials.sbt')
sh('cp /sbt-credentials/repositories /root/.sbt/')
}
if (env.BRANCH_NAME == 'fork-master') {
stage('Deploy') {
sh('sbt publish')
}
} else {
stage('Test') {
sh('sbt test')
}
}
}
}
}
31 changes: 21 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
val artifactory = "https://cognite.jfrog.io/cognite/"
inThisBuild(
List(
organization := "org.lyranthe.fs2-grpc",
organization := "com.cognite.fs2-grpc",
git.useGitDescribe := true,
scmInfo := Some(ScmInfo(url("https://github.com/fiadliel/fs2-grpc"), "[email protected]:fiadliel/fs2-grpc.git"))
scmInfo := Some(ScmInfo(url("https://github.com/cognitedata/fs2-grpc"), "[email protected]:cognitedata/fs2-grpc.git")),
resolvers += "libs-release" at artifactory + "libs-release/",
version := "0.4.10"
))

lazy val root = project.in(file("."))
.enablePlugins(GitVersioning, BuildInfoPlugin)
.enablePlugins(BuildInfoPlugin)
.settings(
sonatypeProfileName := "org.lyranthe",
skip in publish := true,
pomExtra in Global := {
<url>https://github.com/fiadliel/fs2-grpc</url>
Expand All @@ -30,22 +32,25 @@ lazy val root = project.in(file("."))
.aggregate(`sbt-java-gen`, `java-runtime`)

lazy val `sbt-java-gen` = project
.enablePlugins(GitVersioning, BuildInfoPlugin)
.enablePlugins(BuildInfoPlugin)
.settings(
publishTo := sonatypePublishTo.value,
sbtPlugin := true,
crossSbtVersions := List(sbtVersion.value, "0.13.18"),
buildInfoPackage := "org.lyranthe.fs2_grpc.buildinfo",
addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.23"),
libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % scalapb.compiler.Version.scalapbVersion
libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % scalapb.compiler.Version.scalapbVersion,
publishTo := {
if (isSnapshot.value)
Some("snapshots" at artifactory + "libs-snapshot-local/")
else
Some("releases" at artifactory + "libs-release-local/")
}
)

lazy val `java-runtime` = project
.enablePlugins(GitVersioning)
.settings(
scalaVersion := "2.12.8",
crossScalaVersions := List(scalaVersion.value, "2.11.12", "2.13.0-M5"),
publishTo := sonatypePublishTo.value,
libraryDependencies ++= List(
"co.fs2" %% "fs2-core" % "1.0.4",
"org.typelevel" %% "cats-effect" % "1.3.1",
Expand All @@ -56,5 +61,11 @@ lazy val `java-runtime` = project
),
mimaPreviousArtifacts := Set(organization.value %% name.value % "0.3.0"),
testFrameworks += new TestFramework("minitest.runner.Framework"),
addCompilerPlugin("org.spire-math" % "kind-projector" % "0.9.9" cross CrossVersion.binary)
addCompilerPlugin("org.spire-math" % "kind-projector" % "0.9.9" cross CrossVersion.binary),
publishTo := {
if (isSnapshot.value)
Some("snapshots" at artifactory + "libs-snapshot-local/")
else
Some("releases" at artifactory + "libs-release-local/")
}
)
1 change: 0 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.3")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")

Expand Down

0 comments on commit 9c526a2

Please sign in to comment.