a bit of prep-work for adding caching

This commit is contained in:
Brad
2014-03-02 22:35:01 -08:00
parent 600bcdea38
commit 18d5421706
5 changed files with 21 additions and 1 deletions

View File

@@ -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.

View File

@@ -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)