diff options
author | Jakob Odersky <jakob@odersky.com> | 2017-03-06 01:32:39 -0800 |
---|---|---|
committer | Jakob Odersky <jakob@odersky.com> | 2017-03-06 01:32:39 -0800 |
commit | 374ac0ce8c10e9063c263ecf9c708f9ee6772973 (patch) | |
tree | a80f53db0a5ee8e3c40e1941b331869a2560164d /crashbox-server/src/main/scala/io/crashbox/ci/Source.scala | |
parent | f9cc5e3f8478eb9f19cca093b8019e579f9c87e6 (diff) | |
download | crashbox-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.scala | 16 |
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) + +} |