This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Robert Kenny
committed
Feb 11, 2020
1 parent
dcf2542
commit 06270dc
Showing
11 changed files
with
519 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,48 @@ | ||
language: scala | ||
|
||
before_script: | ||
- openssl aes-256-cbc -K $encrypted_0ed9b3e7612f_key -iv $encrypted_0ed9b3e7612f_iv -in secrets.zip.enc -out secrets.zip -d | ||
- git remote add ssh-origin "git@github.com:wellcomecollection/sierra-streams-source.git" | ||
|
||
cache: | ||
directories: | ||
- $HOME/.sbt | ||
- $HOME/.ivy2/cache | ||
- project/target | ||
|
||
# Everything below this line is boilerplate that should be reusable, | ||
# unmodified, in any of our Scala library repos. | ||
|
||
sudo: false | ||
|
||
scala: | ||
- 2.11.11 | ||
- 2.12.6 | ||
- 2.12.6 | ||
|
||
branches: | ||
only: | ||
- master | ||
|
||
env: | ||
global: | ||
# This forces Python to print everything to stdout/stderr immediately. | ||
- PYTHONUNBUFFERED=x | ||
|
||
jobs: | ||
include: | ||
- stage: check_commits | ||
script: | ||
- sbt "show suggestedBump"; | ||
|
||
- stage: release | ||
script: | ||
- openssl aes-256-cbc -K $encrypted_12c8071d2874_key -iv $encrypted_12c8071d2874_iv -in credentials.sbt.enc -out credentials.sbt -d | ||
- openssl aes-256-cbc -K $encrypted_0f90593c4cb0_key -iv $encrypted_0f90593c4cb0_iv -in keys.zip.enc -out keys.zip -d | ||
- unzip keys.zip; | ||
- git config user.name "Travis CI on behalf of Wellcome" | ||
- git config user.email "wellcomedigitalplatform@wellcome.ac.uk" | ||
- git config core.sshCommand "ssh -i ssh-key/id_rsa" | ||
- git remote set-url origin "git@github.com:wellcometrust/sierra-streams-source.git" | ||
- sbt ++$TRAVIS_SCALA_VERSION release; | ||
- stage: format | ||
env: TASK=format | ||
- stage: test | ||
env: TASK=test | ||
services: | ||
- docker | ||
- stage: release | ||
env: TASK=release | ||
|
||
script: | ||
- ./sbt_release_tooling.py "$TASK" | ||
|
||
stages: | ||
- test | ||
- name: check_commits | ||
if: type = pull_request | ||
- name: release | ||
if: type = push | ||
- format | ||
- test | ||
- name: release | ||
if: type = push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,33 @@ | ||
import sbt.Resolver | ||
import sbtrelease.{Version, versionFormatError} | ||
|
||
organization := "uk.ac.wellcome" | ||
|
||
name := "sierra-streams-source" | ||
|
||
crossScalaVersions := Seq("2.11.11", "2.12.6") | ||
|
||
|
||
val versions = new { | ||
val logback = "1.1.8" | ||
val scalatest = "3.0.1" | ||
val circeVersion = "0.8.0" | ||
} | ||
|
||
val circeDependencies = Seq( | ||
"io.circe" %% "circe-core" % versions.circeVersion, | ||
"io.circe" %% "circe-generic"% versions.circeVersion, | ||
"io.circe" %% "circe-parser"% versions.circeVersion, | ||
"io.circe" %% "circe-optics" % versions.circeVersion | ||
val projectName = "sierra-streams-source" | ||
val projectVersion = "1.0.0" | ||
|
||
val settings: Seq[Def.Setting[_]] = Seq( | ||
scalaVersion := "2.12.6", | ||
organization := "uk.ac.wellcome", | ||
scalacOptions ++= Seq( | ||
"-deprecation", | ||
"-unchecked", | ||
"-encoding", | ||
"UTF-8", | ||
"-Xlint", | ||
"-Xverify", | ||
"-Xfatal-warnings", | ||
"-feature", | ||
"-language:postfixOps" | ||
), | ||
parallelExecution in Test := false, | ||
resolvers ++= Seq( | ||
"S3 releases" at "s3://releases.mvn-repo.wellcomecollection.org/" | ||
), | ||
publishMavenStyle := true, | ||
publishTo := Some( | ||
"S3 releases" at "s3://releases.mvn-repo.wellcomecollection.org/" | ||
), | ||
publishArtifact in Test := true, | ||
version := projectVersion | ||
) | ||
|
||
libraryDependencies := Seq( | ||
"com.github.tomakehurst" % "wiremock" % "2.11.0" % Test, | ||
"org.scalaj" %% "scalaj-http" % "2.3.0", | ||
"org.scalatest" %% "scalatest" % versions.scalatest % Test, | ||
"ch.qos.logback" % "logback-classic" % versions.logback, | ||
"org.slf4j" % "slf4j-api" % "1.7.25", | ||
"com.typesafe.akka" %% "akka-stream" % "2.5.6", | ||
"com.typesafe.akka" %% "akka-stream-testkit" % "2.5.6" % Test | ||
) ++ circeDependencies | ||
|
||
resolvers += Resolver.sonatypeRepo("releases") | ||
|
||
scalacOptions ++= Seq( | ||
"-deprecation", | ||
"-unchecked", | ||
"-encoding", | ||
"UTF-8", | ||
"-Xlint", | ||
"-Xverify", | ||
"-feature", | ||
"-language:postfixOps" | ||
) | ||
|
||
// We don't publish SNAPSHOTS but the checkSnapshotDependencies | ||
// step in the releaseProcess checks that the SNAPSHOT version is | ||
// compatible with sonatype and fails without these two lines. | ||
dynverSonatypeSnapshots in ThisBuild := true | ||
version in ThisBuild ~= (_.replace('+', '-')) | ||
|
||
publishTo := Some(Opts.resolver.sonatypeStaging) | ||
|
||
useGpg := false | ||
|
||
parallelExecution in Test := false | ||
|
||
pgpPublicRing := baseDirectory.value / "pgp-key" / "pubring.asc" | ||
pgpSecretRing := baseDirectory.value / "pgp-key" / "secring.asc" | ||
|
||
releaseVersion := { ver: String =>Version(ver) | ||
.map(_.withoutQualifier) | ||
.map(_.bump(suggestedBump.value).string).getOrElse(versionFormatError) | ||
} | ||
|
||
// we hide the existing definition for setReleaseVersion to replace it with our own | ||
import sbtrelease.ReleaseStateTransformations.{setReleaseVersion=>_,_} | ||
|
||
// This creates a release stage that gets the version from the dynamic one | ||
// based on tags generated by sbt-dynver plugin. | ||
// Inspired from https://blog.byjean.eu/2015/07/10/painless-release-with-sbt.html | ||
lazy val setReleaseVersion: ReleaseStep = { st: State => | ||
val extracted = Project.extract(st) | ||
val currentVersion = extracted.get(version) | ||
|
||
val getReleaseVersionFunction = extracted.runTask(releaseVersion, st)._2 | ||
val selectedVersion = getReleaseVersionFunction(currentVersion) | ||
|
||
st.log.info("Setting version to '%s'." format selectedVersion) | ||
val useGlobal =Project.extract(st).get(releaseUseGlobalVersion) | ||
val versionStr = (if (useGlobal) globalVersionString else versionString) format selectedVersion | ||
|
||
reapply(Seq( | ||
if (useGlobal) version in ThisBuild := selectedVersion | ||
else version := selectedVersion | ||
), st) | ||
} | ||
|
||
// In sbt-autoversion plugin, minor is the default bump | ||
// strategy as the minorRegexes matches any string. | ||
// Let's override that so figuring out the next version fails if | ||
// there are no commits that explicitly specify the bumping strategy | ||
minorRegexes := List("""\[?minor\]?.*""").map(_.r) | ||
|
||
releaseProcess := Seq( | ||
checkSnapshotDependencies, | ||
setReleaseVersion, | ||
tagRelease, | ||
releaseStepCommandAndRemaining("+publishSigned"), | ||
releaseStepCommand("sonatypeReleaseAll"), | ||
releaseStepCommand(s"git push origin --tags") | ||
) | ||
lazy val root = (project in file(".")) | ||
.withId(projectName) | ||
.settings(settings) | ||
.settings(libraryDependencies ++= Dependencies.libraryDependencies) |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import sbt._ | ||
|
||
object Dependencies { | ||
lazy val versions = new { | ||
val aws = "1.11.225" | ||
val akka = "2.5.9" | ||
val akkaStreamAlpakka = "0.20" | ||
val circe = "0.9.0" | ||
val circeYaml = "0.8.0" | ||
val scalatest = "3.0.1" | ||
val logback = "1.2.3" | ||
} | ||
|
||
val logbackDependencies = Seq( | ||
"ch.qos.logback" % "logback-classic" % versions.logback | ||
) | ||
|
||
val akkaDependencies: Seq[ModuleID] = Seq( | ||
"com.typesafe.akka" %% "akka-actor" % versions.akka, | ||
"com.typesafe.akka" %% "akka-stream" % versions.akka | ||
) | ||
|
||
val circeDependencies = Seq( | ||
"io.circe" %% "circe-core" % versions.circe, | ||
"io.circe" %% "circe-parser" % versions.circe | ||
) | ||
|
||
val testDependencies = Seq( | ||
"org.scalatest" %% "scalatest" % versions.scalatest % Test | ||
) | ||
|
||
val libraryDependencies = Seq( | ||
"com.github.tomakehurst" % "wiremock" % "2.11.0" % Test, | ||
"org.scalaj" %% "scalaj-http" % "2.3.0", | ||
"org.scalatest" %% "scalatest" % versions.scalatest % Test, | ||
"ch.qos.logback" % "logback-classic" % versions.logback, | ||
"org.slf4j" % "slf4j-api" % "1.7.25", | ||
"com.typesafe.akka" %% "akka-stream" % "2.5.6", | ||
"com.typesafe.akka" %% "akka-stream-testkit" % "2.5.6" % Test | ||
) ++ circeDependencies | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version = 1.0.3 | ||
sbt.version=1.1.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.0") | ||
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0") | ||
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "3.0.0") | ||
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.8") | ||
addSbtPlugin("org.scala-sbt" % "sbt-autoversion" % "1.0.0") | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") | ||
addSbtPlugin("com.tapad" % "sbt-docker-compose" % "1.0.34") | ||
addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.16.0") | ||
addSbtPlugin("com.lucidchart" % "sbt-scalafmt-coursier" % "1.15") |
Oops, something went wrong.