From 52750bad48fc98d9a6de1e1d6caa7541060a250b Mon Sep 17 00:00:00 2001 From: Tim Shannon Date: Wed, 4 May 2016 08:35:36 -0500 Subject: [PATCH] Changed behavior so triggered builds ignore version Version checks are only done on polling projects. --- cycle.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/cycle.go b/cycle.go index 9ddf1ee..23e4755 100644 --- a/cycle.go +++ b/cycle.go @@ -110,18 +110,20 @@ func (p *Project) fetch() { p.setVersion(strings.TrimSpace(string(version))) - // check if this specific version has attempted a build yet - lVer, err := p.ds.LastVersion(stageBuild) - if err != datastore.ErrNotFound && p.errHandled(err) { - return - } + if p.poll > 0 { + // if polling, check if this specific version has attempted a build yet + lVer, err := p.ds.LastVersion(stageBuild) + if err != datastore.ErrNotFound && p.errHandled(err) { + return + } - if p.version == "" || p.version == lVer.Version { - // no new build clean up temp dir - p.errHandled(os.RemoveAll(tempDir)) + if p.version == "" || p.version == lVer.Version { + // no new build clean up temp dir + p.errHandled(os.RemoveAll(tempDir)) - vlog("No new version found for Project: %s Version: %s.\n", p.id(), p.version) - return + vlog("No new version found for Project: %s Version: %s.\n", p.id(), p.version) + return + } } //remove any existing data that matches version hash