summaryrefslogtreecommitdiff
path: root/crashbox-server/src/main/scala/io/crashbox/ci/Source.scala
diff options
context:
space:
mode:
authorJakob Odersky <jakob@odersky.com>2017-03-06 01:32:39 -0800
committerJakob Odersky <jakob@odersky.com>2017-03-06 01:32:39 -0800
commit374ac0ce8c10e9063c263ecf9c708f9ee6772973 (patch)
treea80f53db0a5ee8e3c40e1941b331869a2560164d /crashbox-server/src/main/scala/io/crashbox/ci/Source.scala
parentf9cc5e3f8478eb9f19cca093b8019e579f9c87e6 (diff)
downloadcrashbox-ci-374ac0ce8c10e9063c263ecf9c708f9ee6772973.tar.gz
crashbox-ci-374ac0ce8c10e9063c263ecf9c708f9ee6772973.tar.bz2
crashbox-ci-374ac0ce8c10e9063c263ecf9c708f9ee6772973.zip
Basic, single-task builder
Diffstat (limited to 'crashbox-server/src/main/scala/io/crashbox/ci/Source.scala')
-rw-r--r--crashbox-server/src/main/scala/io/crashbox/ci/Source.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/crashbox-server/src/main/scala/io/crashbox/ci/Source.scala b/crashbox-server/src/main/scala/io/crashbox/ci/Source.scala
new file mode 100644
index 0000000..720b809
--- /dev/null
+++ b/crashbox-server/src/main/scala/io/crashbox/ci/Source.scala
@@ -0,0 +1,16 @@
+package io.crashbox.ci
+
+import java.io.File
+import java.net.URL
+import org.eclipse.jgit.api.Git
+import scala.concurrent.Future
+
+trait Source { self: Core =>
+
+ def fetchSource(from: URL, to: File): Future[File] = Future {
+ log.debug(s"Cloning git repo from $from to $to")
+ Git.cloneRepository.setURI(from.toURI.toString).setDirectory(to).call()
+ to
+ }(blockingDispatcher)
+
+}