use same cached volumes between branches

This commit is contained in:
Nathan Williams 2015-03-11 12:21:08 -07:00
parent ea3ea059e0
commit 9eb82d6ceb

View file

@ -362,7 +362,6 @@ func (b *Builder) run() error {
conf.Volumes = make(map[string]struct{}) conf.Volumes = make(map[string]struct{})
for _, volume := range b.Build.Cache { for _, volume := range b.Build.Cache {
name := filepath.Clean(b.Repo.Name) name := filepath.Clean(b.Repo.Name)
branch := filepath.Clean(b.Repo.Branch)
volume := filepath.Clean(volume) volume := filepath.Clean(volume)
// with Docker, volumes must be an absolute path. If an absolute // with Docker, volumes must be an absolute path. If an absolute
@ -374,7 +373,7 @@ func (b *Builder) run() error {
// local cache path on the host machine // local cache path on the host machine
// this path is going to be really long // this path is going to be really long
hostpath := filepath.Join(tmpPath, name, branch, volume) hostpath := filepath.Join(tmpPath, name, volume)
// check if the volume is created // check if the volume is created
if _, err := os.Stat(hostpath); err != nil { if _, err := os.Stat(hostpath); err != nil {