Merge "Allow disabling build-log-retention"

This commit is contained in:
Zuul 2020-05-12 20:59:37 +00:00 committed by Gerrit Code Review
commit 47193a46b9
3 changed files with 8 additions and 1 deletions

View File

@ -83,7 +83,7 @@ Options
they exceed this value. This option specifies how many will be
kept (usually you will see one more, as deletion happens before
starting a new build). By default, the last 7 old build logs are
kept.
kept. Set this to ``-1`` to disable removal of logs.
.. attr:: zookeeper-servers
:type: list

View File

@ -592,6 +592,8 @@ class BuildWorker(BaseWorker):
return log_dir
def _pruneBuildLogs(self, name):
if self._config.build_log_retention < 0:
return
log_dir = self._getBuildLogRoot(name)
keep = max(self._config.build_log_retention, 1)
existing = sorted(os.listdir(log_dir))

View File

@ -0,0 +1,5 @@
---
features:
- |
Setting ``build-log-retention`` to ``-1`` will disable the removal of
old build logs.