diff --git a/.buildkite/pipeline.exec.sh b/.buildkite/pipeline.exec.sh new file mode 100755 index 0000000..f19beb1 --- /dev/null +++ b/.buildkite/pipeline.exec.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -o errexit +set -o errtrace +set -o nounset +set -o pipefail + +git config --global user.email "team@getnelson.io" +git config --global user.name "Nelson Team" + +# subvert the sbt-rig plugin +export TRAVIS="true" # way hacky +export TRAVIS_COMMIT="$BUILDKITE_COMMIT" +export TRAVIS_REPO_SLUG="getnelson/knobs" +export TRAVIS_BUILD_NUMBER="$BUILDKITE_BUILD_NUMBER" +export KNOBS_TEST_DIR="knobs-test" + +if [ "${BUILDKITE_PULL_REQUEST:-}" = 'false' ]; then + git checkout -qf "$BUILDKITE_BRANCH"; +fi + +echo "--> running build for ${TRAVIS_SCALA_VERSION}..." +eval "sbt ++${TRAVIS_SCALA_VERSION} 'release with-defaults'" diff --git a/.buildkite/pipeline.teardown.sh b/.buildkite/pipeline.teardown.sh new file mode 100755 index 0000000..9ec7e43 --- /dev/null +++ b/.buildkite/pipeline.teardown.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +echo "==>> initilizing doctl..." +doctl auth init -t "${DIGITAL_OCEAN_API_TOKEN}" + +echo "==>> deleting the droplet..." +doctl compute droplet list | grep -v 'ID' | sort -r -k1 | grep "buildkite-worker" | awk '{print $1}' | xargs -L1 doctl compute droplet delete -f diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 0000000..26837b4 --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,34 @@ +--- +steps: + - label: ":hammer: build" + command: .buildkite/pipeline.exec.sh + timeout_in_minutes: 45 + branches: master + env: + BUILDKITE_CLEAN_CHECKOUT: true + TRAVIS_SCALA_VERSION: "2.11.12" + TRAVIS_JOB_NUMBER: "1.1" + agents: + os: linux + + - label: ":hammer: build" + command: .buildkite/pipeline.exec.sh + timeout_in_minutes: 45 + branches: master + env: + BUILDKITE_CLEAN_CHECKOUT: true + TRAVIS_SCALA_VERSION: "2.12.4" + TRAVIS_JOB_NUMBER: "1.2" + agents: + os: linux + + - wait: ~ + continue_on_failure: true + + - label: ":radioactive_sign: teardown" + command: .buildkite/pipeline.teardown.sh + branches: master + env: + - BUILDKITE_CLEAN_CHECKOUT: true + agents: + os: linux diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1ecdc9f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -language: scala - -matrix: - include: - # scala 2.11 - - jdk: oraclejdk8 - scala: 2.11.12 - # scala 2.12 - - jdk: oraclejdk8 - scala: 2.12.4 - -branches: - only: - - master - -before_script: - - "if [ $TRAVIS_PULL_REQUEST = 'false' ]; then git checkout -qf $TRAVIS_BRANCH; fi" - -script: - - | - if [ $TRAVIS_PULL_REQUEST = 'false' ]; then - if [ $RELEASE_ON_PUSH = 'false' ]; then - sbt ++$TRAVIS_SCALA_VERSION test coverageReport - else - sbt ++$TRAVIS_SCALA_VERSION 'release with-defaults' - fi - else - sbt ++$TRAVIS_SCALA_VERSION test coverageReport - fi - - find $HOME/.sbt -name "*.lock" | xargs rm - - find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm - -cache: - directories: - - $HOME/.ivy2/cache - - $HOME/.sbt/boot/scala-$TRAVIS_SCALA_VERSION - -after_success: - - find $HOME/.sbt -name "*.lock" | xargs rm - - find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm - - "bash <(curl -s https://codecov.io/bash) -r $TRAVIS_REPO_SLUG -t $CODECOV_TOKEN" - -env: - global: - - secure: "emCycBlDj0nwdK/SI4q/38WGlZS1tvttZbgzb38KegPUIOv6hr78L73t/2pb8FT/AHPdhYF4q6q8AXxAJi3QoiznMSAT1xyxZZ+wWrWqPuphhkqMSEdzcG8fbi3YGkB0sl+7ZLsveUg/JmG6j6NFjzWjRjb6Rn9MUWKGWDs5a8g=" - - secure: "RKDMtxH135S+urp/t92qAwe1L0oGDuheKSXBcjwU55v2OS1NX4GPzE64y9hCuYK43BkXB1Xv/mMnF55TYSjHHpnP4BUXW0/SIERrwM+JFQ1TiukocMNiRUZ0jzZ6sUl7wpwhDntXR//jb/6+gCxC7hdlYUQgQ6qjCQffBZT0RzY=" - - secure: "lqLNd52nASivxq6IFYsq7UIBbH2eHVcvqSbOGFkzDsWscBoeWl5BvM1uOGFRoU3kJB3L23tK3Dq8rfIMXUh6ghPQpMlLKNtQ1XiTIm0s5MqY4JqmRbSLb6eexof/sUE6CgtwTlYp6LTQzT0NLdlBsvyySq5EkfJqeMVH0K7uu5Y=" - - KNOBS_TEST_DIR="knobs-test" diff --git a/README.md b/README.md index 95f41f7..3480a46 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ Knobs ![image](docs/src/site/img/logo.png) [![Join the chat at https://gitter.im/oncue/knobs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/oncue/knobs) -[![Build Status](https://travis-ci.org/Verizon/knobs.svg?branch=master)](https://travis-ci.org/Verizon/knobs) -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.verizon.knobs/core_2.11/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.verizon.knobs/core_2.11) -[![codecov](https://codecov.io/gh/Verizon/knobs/branch/master/graph/badge.svg)](https://codecov.io/gh/Verizon/knobs) +[![Build Status](https://travis-ci.org/getnelson/knobs.svg?branch=master)](https://travis-ci.org/getnelson/knobs) +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.getnelson.knobs/core_2.11/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.getnelson.knobs/core_2.11) +[![codecov](https://codecov.io/gh/getnelson/knobs/branch/master/graph/badge.svg)](https://codecov.io/gh/getnelson/knobs) -Please [view the documentation](http://oncue.github.io/knobs/) for more information, and go to [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.verizon.knobs%22) for the latest releases. +Please [view the documentation](http://oncue.github.io/knobs/) for more information, and go to [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.getnelson.knobs%22) for the latest releases. diff --git a/core/build.sbt b/core/build.sbt index 7a45bf0..fc3bac0 100644 --- a/core/build.sbt +++ b/core/build.sbt @@ -1,10 +1,29 @@ -resolvers ++= Seq( - "oncue.bintray" at "http://dl.bintray.com/oncue/releases" +//: ---------------------------------------------------------------------------- +//: Copyright (C) 2017 Verizon. All Rights Reserved. +//: +//: Licensed under the Apache License, Version 2.0 (the "License"); +//: you may not use this file except in compliance with the License. +//: You may obtain a copy of the License at +//: +//: http://www.apache.org/licenses/LICENSE-2.0 +//: +//: Unless required by applicable law or agreed to in writing, software +//: distributed under the License is distributed on an "AS IS" BASIS, +//: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//: See the License for the specific language governing permissions and +//: limitations under the License. +//: +//: ---------------------------------------------------------------------------- +import verizon.build._ + +enablePlugins(ScalaTestPlugin) + +libraryDependencies ++= Seq( + "co.fs2" %% "fs2-core" % "1.0.0", + "io.verizon.ermine" %% "parser" % "0.5.9" ) -libraryDependencies ++= { - Seq( - "co.fs2" %% "fs2-core" % "1.0.0", - "io.verizon.ermine" %% "parser" % "0.5.9" - ) -} + +scalaTestVersion := "3.0.5" + +scalaCheckVersion := "1.13.5" diff --git a/docs/build.sbt b/docs/build.sbt index 7af94a3..ea1612c 100644 --- a/docs/build.sbt +++ b/docs/build.sbt @@ -1,20 +1,23 @@ -import com.typesafe.sbt.SbtSite.SiteKeys._ -import com.typesafe.sbt.SbtGhPages.GhPagesKeys._ - -enablePlugins(DisablePublishingPlugin) -disablePlugins(BinCompatPlugin) - -site.settings - -tutSettings - -site.addMappingsToSiteDir(tut, "") - -ghpages.settings - -ghpagesNoJekyll := false - -includeFilter in makeSite := "*.yml" | "*.md" | "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" - -git.remoteRepo := "git@github.com:Verizon/knobs.git" - +//: ---------------------------------------------------------------------------- +//: Copyright (C) 2017 Verizon. All Rights Reserved. +//: +//: Licensed under the Apache License, Version 2.0 (the "License"); +//: you may not use this file except in compliance with the License. +//: You may obtain a copy of the License at +//: +//: http://www.apache.org/licenses/LICENSE-2.0 +//: +//: Unless required by applicable law or agreed to in writing, software +//: distributed under the License is distributed on an "AS IS" BASIS, +//: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//: See the License for the specific language governing permissions and +//: limitations under the License. +//: +//: ---------------------------------------------------------------------------- + +// enablePlugins(TutPlugin, DisablePublishingPlugin) +// disablePlugins(BinCompatPlugin) + +// includeFilter in makeSite := "*.yml" | "*.md" | "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" + +// git.remoteRepo := "git@github.com:getnelson/knobs.git" diff --git a/docs/src/main/tut/usage.md b/docs/src/main/tut/usage.md index ac8281f..cd19e9a 100644 --- a/docs/src/main/tut/usage.md +++ b/docs/src/main/tut/usage.md @@ -11,10 +11,10 @@ section: "usage" First you need to add the dependency for Knobs to your `build.scala` or your `build.sbt` file: ```` -libraryDependencies += "io.verizon.knobs" %% "core" % "x.x.+" +libraryDependencies += "io.getnelson.knobs" %% "core" % "x.x.+" ```` -Where `x.x` is the desired Knobs version. Knobs follows traditional [semantic versioning](semver). Check for the latest release [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.verizon.knobs%22). +Where `x.x` is the desired Knobs version. Knobs follows traditional [semantic versioning](semver). Check for the latest release [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.getnelson.knobs%22). [semver]: https://semver.org/ @@ -46,9 +46,12 @@ To require the file "foo.cfg" from the classpath: ```tut import knobs.{Required,ClassPathResource,Config} -import cats.effect.IO +import cats.effect.{ContextShift, IO} import scala.concurrent.ExecutionContext.Implicits.global +// Provided automatically if you're in IOApp +implicit val cs: ContextShift[IO] = IO.contextShift(global) + val cfg: IO[Config] = knobs.loadImmutable[IO]( Required(ClassPathResource("foo.cfg")) :: Nil) ``` @@ -268,7 +271,7 @@ val c1: IO[Config] = val cfg = for { a <- c1 - b <- aws.config + b <- aws.config[IO] } yield a ++ b ``` diff --git a/project.sbt b/project.sbt index c05b16e..ca8ced5 100644 --- a/project.sbt +++ b/project.sbt @@ -14,7 +14,7 @@ //: limitations under the License. //: //: ---------------------------------------------------------------------------- -organization in Global := "io.verizon.knobs" +organization in Global := "io.getnelson.knobs" crossScalaVersions in Global := Seq("2.12.4", "2.11.12") @@ -22,15 +22,15 @@ scalaVersion in Global := crossScalaVersions.value.head scalacOptions in Global := Seq("-Ypartial-unification") -lazy val knobs = project.in(file(".")).aggregate(core, typesafe, zookeeper, docs) +lazy val knobs = project.in(file(".")).aggregate(core, typesafe, zookeeper) lazy val core = project -lazy val typesafe = project.dependsOn(core) +lazy val typesafe = project.dependsOn(core % "test->test;compile->compile") -lazy val zookeeper = project.dependsOn(core) +lazy val zookeeper = project.dependsOn(core % "test->test;compile->compile") -lazy val docs = project.dependsOn(core, zookeeper) +lazy val docs = project.dependsOn(zookeeper) enablePlugins(DisablePublishingPlugin) diff --git a/project/CentralRequirementsPlugin.scala b/project/CentralRequirementsPlugin.scala index 58e338f..cbf3fd0 100644 --- a/project/CentralRequirementsPlugin.scala +++ b/project/CentralRequirementsPlugin.scala @@ -26,7 +26,7 @@ object CentralRequirementsPlugin extends AutoPlugin { override def requires = RigPlugin override lazy val projectSettings = Seq( - sonatypeProfileName := "io.verizon", + sonatypeProfileName := "io.getnelson", pomExtra in Global := { @@ -47,8 +47,8 @@ object CentralRequirementsPlugin extends AutoPlugin { }, licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")), - homepage := Some(url("http://verizon.github.io/knobs/")), - scmInfo := Some(ScmInfo(url("https://github.com/verizon/knobs"), - "git@github.com:verizon/knobs.git")) + homepage := Some(url("http://getnelson.github.io/knobs/")), + scmInfo := Some(ScmInfo(url("https://github.com/getnelson/knobs"), + "git@github.com:getnelson/knobs.git")) ) } diff --git a/project/build.properties b/project/build.properties index 1d1766f..8b697bb 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1,17 +1 @@ -//: ---------------------------------------------------------------------------- -//: Copyright (C) 2017 Verizon. All Rights Reserved. -//: -//: Licensed under the Apache License, Version 2.0 (the "License"); -//: you may not use this file except in compliance with the License. -//: You may obtain a copy of the License at -//: -//: http://www.apache.org/licenses/LICENSE-2.0 -//: -//: Unless required by applicable law or agreed to in writing, software -//: distributed under the License is distributed on an "AS IS" BASIS, -//: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//: See the License for the specific language governing permissions and -//: limitations under the License. -//: -//: ---------------------------------------------------------------------------- -sbt.version=0.13.16 +sbt.version=1.1.0 diff --git a/project/plugins.sbt b/project/plugins.sbt index 733074d..1bce43a 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -19,15 +19,8 @@ resolvers += Resolver.url( url("http://dl.bintray.com/content/tpolecat/sbt-plugin-releases"))( Resolver.ivyStylePatterns) -addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.3") -addSbtPlugin("io.verizon.build" % "sbt-rig" % "2.0.29") +addSbtPlugin("io.verizon.build" % "sbt-rig" % "5.0.39") // docs -addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.8.1") -addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.3") -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.14") -addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.4.7") -addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.3.2") - -scalacOptions += "-deprecation" - +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.14") +addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.7") diff --git a/typesafe/build.sbt b/typesafe/build.sbt index c1f3c5c..841ad01 100644 --- a/typesafe/build.sbt +++ b/typesafe/build.sbt @@ -1,2 +1,19 @@ -// 1.3.0 is out but it depends on java 1.8. +//: ---------------------------------------------------------------------------- +//: Copyright (C) 2017 Verizon. All Rights Reserved. +//: +//: Licensed under the Apache License, Version 2.0 (the "License"); +//: you may not use this file except in compliance with the License. +//: You may obtain a copy of the License at +//: +//: http://www.apache.org/licenses/LICENSE-2.0 +//: +//: Unless required by applicable law or agreed to in writing, software +//: distributed under the License is distributed on an "AS IS" BASIS, +//: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//: See the License for the specific language governing permissions and +//: limitations under the License. +//: +//: ---------------------------------------------------------------------------- +import verizon.build._ + libraryDependencies += "com.typesafe" % "config" % "1.3.3"