https://github.com/softprops/track-jacket
A slimly outfitted interface for getting your app up and running with marathon
https://github.com/softprops/track-jacket
Last synced: about 1 year ago
JSON representation
A slimly outfitted interface for getting your app up and running with marathon
- Host: GitHub
- URL: https://github.com/softprops/track-jacket
- Owner: softprops
- License: mit
- Created: 2013-10-22T05:13:53.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-21T12:45:27.000Z (almost 12 years ago)
- Last Synced: 2025-03-17T12:00:03.815Z (over 1 year ago)
- Language: Scala
- Homepage:
- Size: 238 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# track jacket
A slimly outfitted interface for getting your app up and running with [marathon](https://github.com/mesosphere/marathon#readme)

## usage
```scala
import trackjacket._
import dispatch._
val cli = Client()
val start =
(cli.start("my_app")
.cmd("java -jar app-1.0.jar")
.uris("/path/to/app-1.0.jar")
.cpus(4)
.instances(4)
.env("env" -> "prod")()).either
for (_ <- start.right) yield println("off you go")
for (_ <- start.left) yield println("whooa nelly")
(for { js <- cli.apps(as.json4s.Json) } yield {
for {
JArray(apps) <- js
JObject(app) <- apps
("id", JString(id)) <- app
("instances", JInt(instances)) <- app
} yield {
log.info(s"service: $id instances requested: $instances")
for (ejs <- cli.endpoint(id)(as.json4s.Json)) yield {
for {
JObject(endpoint) <- ejs
("instances", JArray(instances)) <- endpoint
JObject(instance) <- instances
("host", JString(host)) <- instance
("ports", JArray(JInt(port) :: _)) <- instance
} yield {
log.info(s"✈ $host:$port")
}
}.apply()
}.apply()
})
```
Doug Tangren (softprops) 2013