diff --git a/Makefile b/Makefile index f5d6a87c7..61af043a5 100644 --- a/Makefile +++ b/Makefile @@ -80,6 +80,7 @@ clean: dpkg: mkdir -p deb/drone/usr/local/bin mkdir -p deb/drone/var/lib/drone + mkdir -p deb/drone/var/cache/drone cp bin/drone deb/drone/usr/local/bin cp bin/droned deb/drone/usr/local/bin -dpkg-deb --build deb/drone diff --git a/cmd/drone/drone.go b/cmd/drone/drone.go index d183e5e79..bb84f5678 100644 --- a/cmd/drone/drone.go +++ b/cmd/drone/drone.go @@ -135,7 +135,11 @@ func run(path string) { // get the repository root directory dir := filepath.Dir(path) - code := repo.Repo{Path: dir} + code := repo.Repo{ + Name: dir, + Branch: "HEAD", // should we do this? + Path: dir, + } // does the local repository match the // $GOPATH/src/{package} pattern? This is diff --git a/pkg/build/repo/repo.go b/pkg/build/repo/repo.go index af8e677c0..6c9c4ea7d 100644 --- a/pkg/build/repo/repo.go +++ b/pkg/build/repo/repo.go @@ -6,6 +6,10 @@ import ( ) type Repo struct { + // The name of the Repository. This should be the + // canonical name, for example, github.com/drone/drone. + Name string + // The path of the Repoisotry. This could be // the remote path of a Git repository or the path of // of the repository on the local file system. diff --git a/pkg/build/script/script.go b/pkg/build/script/script.go index 204892803..3a5e7ddbb 100644 --- a/pkg/build/script/script.go +++ b/pkg/build/script/script.go @@ -61,6 +61,10 @@ type Build struct { // hostname mappings. Hosts []string + // Cache lists a set of directories that should + // persisted between builds. + Cache []string + // Services specifies external services, such as // database or messaging queues, that should be // linked to the build environment. @@ -108,6 +112,12 @@ func (b *Build) WriteBuild(f *buildfile.Buildfile) { f.WriteEnv(parts[0], parts[1]) } + // add hostfile definitions + //for _, mapping := range b.Hosts { + // f.WriteCmdSilent(fmt.Sprintf("[ -f /usr/bin/sudo ] || echo %q | tee -a /etc/hosts", mapping)) + // f.WriteCmdSilent(fmt.Sprintf("[ -f /usr/bin/sudo ] && echo %q | sudo tee -a /etc/hosts", mapping)) + //} + // append build commands for _, cmd := range b.Script { f.WriteCmd(cmd) diff --git a/pkg/queue/worker.go b/pkg/queue/worker.go index d89178bae..174eb69eb 100644 --- a/pkg/queue/worker.go +++ b/pkg/queue/worker.go @@ -170,6 +170,7 @@ func (w *worker) execute(task *BuildTask) error { func (w *worker) runBuild(task *BuildTask, buf io.Writer) (bool, error) { repo := &r.Repo{ + Name: task.Repo.Slug, Path: task.Repo.URL, Branch: task.Commit.Branch, Commit: task.Commit.Hash,