jonas / sbt-dcos   0.1.2

Apache License 2.0 GitHub

DC/OS command line wrapper for sbt

Scala versions: 2.10
sbt plugins: 0.13

sbt-dcos

Travis CI Status Bintray Latest Version Badge

Provides a managed DC/OS CLI binary.

Usage

To use this library in your sbt project add the following line to project/plugins.sbt:

addSbtPlugin("io.github.jonas" % "sbt-dcos" % "0.1.2")

Then use to deploy, for example to Marathon:

val deploy = taskKey[Unit]("Deploy app")

deploy := {
  val appId = name.value
  val json = baseDirectory.value / "marathon.json"

  def marathon(args: String*) =
    Process(dcosCli.value.getAbsolutePath :: "marathon" :: args.toList)

  if (marathon("task", "list", appId).!!.contains(appId))
    marathon("app", "update", "--force", appId) #< json ! streams.value.log
  else
    marathon("app", "add") #< json ! streams.value.log
  ()
}

Releasing

To release version x.y.z run:

> sbt release -Dproject.version=x.y.z

License

sbt-dcos is licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.

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.