summaryrefslogtreecommitdiff
path: root/crashbox-server/src/main/scala/io/crashbox/ci/Main.scala
diff options
context:
space:
mode:
Diffstat (limited to 'crashbox-server/src/main/scala/io/crashbox/ci/Main.scala')
-rw-r--r--crashbox-server/src/main/scala/io/crashbox/ci/Main.scala24
1 files changed, 13 insertions, 11 deletions
diff --git a/crashbox-server/src/main/scala/io/crashbox/ci/Main.scala b/crashbox-server/src/main/scala/io/crashbox/ci/Main.scala
index 55971b1..ae9499d 100644
--- a/crashbox-server/src/main/scala/io/crashbox/ci/Main.scala
+++ b/crashbox-server/src/main/scala/io/crashbox/ci/Main.scala
@@ -6,22 +6,24 @@ import akka.http.scaladsl.Http
import scala.concurrent._
import scala.concurrent.duration._
-object Main
- extends Core
- with Schedulers
- with Storage
- with Executors
- with Parsers
- with Source
- with HttpApi {
+object Main {
+
+ implicit val core = new Core()
+ import core._
+
+ val storage = new Storage()
+ val executor = new DockerExecutor
+ val scheduler = new Scheduler(executor, storage)
+ val api = new HttpApi(scheduler, storage)
+
def main(args: Array[String]): Unit = {
- reapDeadBuilds()
- Await.result(setupDatabase(), 10.seconds)
+ executor.reapDeadBuilds()
+ Await.result(storage.setupDatabase(), 10.seconds)
val host = config.getString("crashbox.host")
val port = config.getInt("crashbox.port")
- Http(system).bindAndHandle(httpApi, host, port) onComplete {
+ Http(system).bindAndHandle(api.httpApi, host, port) onComplete {
case Success(_) =>
log.info(s"Listening on $host:$port")
case Failure(ex) =>