a bit of prep-work for adding caching
This commit is contained in:
parent
600bcdea38
commit
18d5421706
5 changed files with 21 additions and 1 deletions
1
Makefile
1
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue