mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot: keep txt files when cleaning builds dirs
This commit is contained in:
parent
b69d40af59
commit
83651c408e
@ -533,10 +533,19 @@ class runbot_build(models.Model):
|
||||
dests = _filter(dest_list=os.listdir(builds_dir), label='workspace')
|
||||
|
||||
for dest in dests:
|
||||
path = os.path.join(builds_dir, dest)
|
||||
if os.path.isdir(path) and os.path.isabs(path):
|
||||
self._logger('Removing build directory')
|
||||
shutil.rmtree(path)
|
||||
build_dir = os.path.join(builds_dir, dest)
|
||||
for f in os.listdir(build_dir):
|
||||
path = os.path.join(build_dir, f)
|
||||
if os.path.isdir(path) and f != 'logs':
|
||||
shutil.rmtree(path)
|
||||
elif f == 'logs':
|
||||
log_path = os.path.join(build_dir, 'logs')
|
||||
for f in os.listdir(log_path):
|
||||
log_file_path = os.path.join(log_path, f)
|
||||
if os.path.isdir(log_file_path):
|
||||
shutil.rmtree(log_file_path)
|
||||
elif not f.endswith('.txt'):
|
||||
os.unlink(log_file_path)
|
||||
|
||||
def _find_port(self):
|
||||
# currently used port
|
||||
|
Loading…
Reference in New Issue
Block a user