Skip to content

Commit

Permalink
Merge pull request #530 from ing-bank/oss-release
Browse files Browse the repository at this point in the history
OSS azure release
  • Loading branch information
jacum authored May 12, 2020
2 parents 2c74fad + cb48b01 commit 58edd63
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 25 deletions.
63 changes: 63 additions & 0 deletions azure-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
trigger:
batch: true
branches:
include:
- master

pool:
vmImage: 'ubuntu-latest'

variables:
- group: SonaTypeCredentials
- group: gpg key
- group: github_token

steps:
- task: DownloadSecureFile@1
name: pubring
inputs:
secureFile: pubring.asc

- task: DownloadSecureFile@1
name: secring
inputs:
secureFile: secring.asc

- task: Bash@3
displayName: 'Build, sign and publish'
inputs:
targetType: 'inline'
script: |
echo $(tty)
ls -la $(pubring.secureFilePath)
ls -la $(secring.secureFilePath)
mkdir ~/.gnupg
chmod -R 700 ~/.gnupg
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
gpg --import $(pubring.secureFilePath)
gpg --batch --import $(secring.secureFilePath)
gpg --version
gpg --list-keys
gpg --list-secret-keys
git checkout master
git config --global user.email "[email protected]"
git config --global user.name "baker release pipeline"
git remote set-url origin "https://jacum:${GIT_AUTH_TOKEN}@github.com/ing-bank/baker"
sbt -Divy.home=${IVY_HOME} -Dsbt.ivy.home=${IVY_HOME} "release with-defaults"
rm -rf $(pubring.secureFilePath)
rm -rf $(secring.secureFilePath)
rm -rf ~/.gnupg
env:
# secrets must be extracted explicitly
USERNAME: $(username)
PASSWORD: $(password)
# passphrase will be passed to sbt plugin from here
PGP_PASSPHRASE: $(gpg key)
# neeeded for gpg to work on headless azure agents
GPG_TTY: /dev/pts/0
GIT_AUTH_TOKEN: $(github_token)
9 changes: 0 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ val commonSettings = Defaults.coreDefaultSettings ++ Seq(
fork := true,
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v"),
javacOptions := Seq("-source", jvmV, "-target", jvmV),
sources in doc := Seq(),
publishArtifact in packageDoc := false,
publishArtifact in packageSrc := false,
scalacOptions := Seq(
"-unchecked",
"-deprecation",
Expand Down Expand Up @@ -123,8 +120,6 @@ lazy val runtime = project.in(file("runtime"))
.settings(scalaPBSettings)
.settings(
moduleName := "baker-runtime",
// we have to exclude the sources because of a compiler bug: https://issues.scala-lang.org/browse/SI-10134
sources in(Compile, doc) := Seq.empty,
libraryDependencies ++=
compileDeps(
akkaActor,
Expand Down Expand Up @@ -174,8 +169,6 @@ lazy val splitBrainResolver = project.in(file("split-brain-resolver"))
.settings(defaultModuleSettings)
.settings(
moduleName := "baker-split-brain-resolver",
// we have to exclude the sources because of a compiler bug: https://issues.scala-lang.org/browse/SI-10134
sources in(Compile, doc) := Seq.empty,
libraryDependencies ++=
compileDeps(
akkaActor,
Expand All @@ -196,8 +189,6 @@ lazy val recipeDsl = project.in(file("recipe-dsl"))
.settings(defaultModuleSettings)
.settings(
moduleName := "baker-recipe-dsl",
// we have to exclude the sources because of a compiler bug: https://issues.scala-lang.org/browse/SI-10134
sources in(Compile, doc) := Seq.empty,
libraryDependencies ++=
compileDeps(
javaxInject,
Expand Down
17 changes: 9 additions & 8 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sbt._
object Dependencies {

val akkaVersion = "2.5.29"

val akkaManagementVersion = "1.0.6"
val http4sVersion = "0.21.3"
val circeVersion = "0.13.0"

Expand All @@ -18,14 +18,15 @@ object Dependencies {
.exclude("com.typesafe.akka", "akka-stream")

val scalaJava8Compat = "org.scala-lang.modules" %% "scala-java8-compat" % "0.9.1"
val scalaTest = "org.scalatest" %% "scalatest" % "3.1.1"
val scalaTest = "org.scalatest" %% "scalatest" % "3.1.2"
val mockito = "org.mockito" % "mockito-all" % "1.10.19"
val mockServer = "org.mock-server" % "mockserver-netty" % "5.10"
val junitInterface = "com.novocode" % "junit-interface" % "0.11"
val junitJupiter = "org.junit.jupiter" % "junit-jupiter-engine" % "5.6.2"

val akkaActor = "com.typesafe.akka" %% "akka-actor" % akkaVersion
val akkaStream = "com.typesafe.akka" %% "akka-stream" % akkaVersion
val akkaProtobuf = "com.typesafe.akka" %% "akka-protobuf" % akkaVersion
val akkaPersistence = "com.typesafe.akka" %% "akka-persistence" % akkaVersion
val akkaPersistenceQuery = "com.typesafe.akka" %% "akka-persistence-query" % akkaVersion
val akkaPersistenceCassandra = "com.typesafe.akka" %% "akka-persistence-cassandra" % "0.103"
Expand All @@ -36,10 +37,10 @@ object Dependencies {
val akkaTestKit = "com.typesafe.akka" %% "akka-testkit" % akkaVersion
val akkaStreamTestKit = "com.typesafe.akka" %% "akka-stream-testkit" % akkaVersion
val akkaMultiNodeTestkit = "com.typesafe.akka" %% "akka-multi-node-testkit" % akkaVersion
val akkaManagementHttp = "com.lightbend.akka.management" %% "akka-management-cluster-http" % "1.0.6"
val akkaClusterBoostrap = "com.lightbend.akka.management" %% "akka-management-cluster-bootstrap" % "1.0.6"
val akkaDiscoveryKube = "com.lightbend.akka.discovery" %% "akka-discovery-kubernetes-api" % "1.0.6"
val akkaBoostrap = "com.lightbend.akka.management" %% "akka-management-cluster-bootstrap" % "1.0.6"
val akkaManagementHttp = "com.lightbend.akka.management" %% "akka-management-cluster-http" % akkaManagementVersion
val akkaClusterBoostrap = "com.lightbend.akka.management" %% "akka-management-cluster-bootstrap" % akkaManagementVersion
val akkaDiscoveryKube = "com.lightbend.akka.discovery" %% "akka-discovery-kubernetes-api" % akkaManagementVersion
val akkaBoostrap = "com.lightbend.akka.management" %% "akka-management-cluster-bootstrap" % akkaManagementVersion

val scalaKafkaClient = "net.cakesolutions" %% "scala-kafka-client" % "2.3.1"
val fs2kafka = "com.github.fd4s" %% "fs2-kafka" % "1.0.0"
Expand All @@ -51,7 +52,7 @@ object Dependencies {

val scalaGraph = "org.scala-graph" %% "graph-core" % "1.13.1"
val scalaGraphDot = "org.scala-graph" %% "graph-dot" % "1.13.0"
val graphvizJava = "guru.nidi" % "graphviz-java" % "0.15.1"
val graphvizJava = "guru.nidi" % "graphviz-java" % "0.16.0"

val kamon = "io.kamon" %% "kamon-bundle" % "2.0.0"
val kamonAkka = "io.kamon" %% "kamon-akka" % "2.0.0"
Expand Down Expand Up @@ -89,7 +90,7 @@ object Dependencies {
val typeSafeConfig = "com.typesafe" % "config" % "1.4.0"

val objenisis = "org.objenesis" % "objenesis" % "3.1"
val jodaTime = "joda-time" % "joda-time" % "2.10.5"
val jodaTime = "joda-time" % "joda-time" % "2.10.6"
val slf4jApi = "org.slf4j" % "slf4j-api" % "1.7.30"
val logback = "ch.qos.logback" % "logback-classic" % "1.2.3"
val scalaCheck = "org.scalacheck" %% "scalacheck" % "1.14.3"
Expand Down
35 changes: 32 additions & 3 deletions project/Publish.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ import xerial.sbt.Sonatype.SonatypeKeys._

object Publish {

lazy val settings = if (sys.env.get("FEEDURL").isDefined) AzureFeed else Sonatype
lazy val settings =
if (sys.env.contains("FEEDURL")) StableToAzureFeed
else if ( (sys.env.contains("USERNAME"))) ReleaseToSonatype
else SuppressJavaDocsAndSources

import aether.AetherKeys._

val AzureFeed = Seq(
val SuppressJavaDocsAndSources = Seq(
sources in doc := Seq(),
publishArtifact in packageDoc := false,
publishArtifact in packageSrc := false
)

val StableToAzureFeed = Seq(
credentials += Credentials(Path.userHome / ".credentials"),
publishTo := Some("pkgs.dev.azure.com" at sys.env.getOrElse("FEEDURL", "")),
publishMavenStyle := true,
Expand All @@ -23,10 +32,28 @@ object Publish {
protected val ossSnapshots = "Sonatype OSS Snapshots" at nexus + "content/repositories/snapshots/"
protected val ossStaging = "Sonatype OSS Staging" at nexus + "service/local/staging/deploy/maven2/"

val Sonatype = Seq(
val ReleaseToSonatype = Seq(
credentials ++= Seq(
Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
sys.env.getOrElse("USERNAME", ""),
sys.env.getOrElse("PASSWORD", "")
),
Credentials(
"GnuPG Key ID",
"gpg",
"303489A85EBB77F6E93E2A254CCF1479F92AE2B7", // key identifier
"ignored" // this field is ignored; passwords are supplied by pinentry
)
),
releaseIgnoreUntrackedFiles := true,
sonatypeProfileName := "com.ing",
licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT")),
homepage := Some(url("https://github.com/ing-bank/baker")),
scmInfo := Some(ScmInfo(
browseUrl = url("https://github.com/ing-bank/baker"),
connection = "scm:[email protected]:ing-bank/baker.git")),
pomExtra := (
<developers>
<developer>
Expand All @@ -38,6 +65,8 @@ object Publish {
publishMavenStyle := true,
publishTo := version((v: String) => Some(if (isSnapshot(v)) ossSnapshots else ossStaging)).value,
publishArtifact in Test := false,
publishArtifact in packageDoc := true,
publishArtifact in packageSrc := true,
pomIncludeRepository := (_ => false),
releaseCrossBuild := true,
releaseProcess := Seq[ReleaseStep](
Expand Down
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")

addSbtPlugin("com.typesafe.sbt" % "sbt-multi-jvm" % "0.4.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.2")

addSbtPlugin("org.vaslabs.kube" % "sbt-kubeyml" % "0.3.4")
addSbtPlugin("org.vaslabs.kube" % "sbt-kubeyml" % "0.3.5")

addSbtPlugin("no.arktekk.sbt" % "aether-deploy" % "0.24.0")
addSbtPlugin("no.arktekk.sbt" % "aether-deploy" % "0.24.1")

libraryDependencies += "org.slf4j" % "slf4j-nop" % "1.7.30"
2 changes: 1 addition & 1 deletion project/scalapb.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
addSbtPlugin("com.thesamet" % "sbt-protoc" % "0.99.31")

libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.10.2"
libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.10.3"
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "3.0.2-SNAPSHOT"
version in ThisBuild := "3.0.4-SNAPSHOT"

0 comments on commit 58edd63

Please sign in to comment.