dist-git plugin - moved cleanup of cct directory
cct directory is now cleared in cleanup() method instead of prepare()
@@ -114,12 +114,6 @@ class Git(object):
subprocess.check_output(["git", "fetch"])
subprocess.check_output(["git", "checkout", "-f", self.branch])
subprocess.check_output(["git", "reset", "--hard", "origin/%s" % self.branch])
- if not subprocess.call(["git", "ls-files", "--error-unmatch", "cct"],
- stdout=open(os.devnull, 'w'),
- stderr=subprocess.STDOUT):
- subprocess.check_call(["git", "rm", "-rf", "cct"],
- stdout=open(os.devnull, 'w'),
- stderr=subprocess.STDOUT)
self.log.debug("Changes pulled")
else:
self.log.info("Cloning %s git repository (%s branch)..." % (self.repo, self.branch))
@@ -137,6 +131,12 @@ class Git(object):
self.log.info("Removing old '%s' directory" % d)
subprocess.check_output(["git", "rm", "-rf", d])
+ if not subprocess.call(["git", "ls-files", "--error-unmatch", "cct"],
+ stdout=open(os.devnull, 'w'),
+ stderr=subprocess.STDOUT):
+ subprocess.check_call(["git", "rm", "-rf", "cct"],
+ stdout=open(os.devnull, 'w'),
+ stderr=subprocess.STDOUT)
def add(self):
# Add new Dockerfile
subprocess.check_call(["git", "add", "Dockerfile"])
