Skip to content

Commit

Permalink
[ADD] more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
hbrunn committed May 14, 2020
1 parent 7fc5b7f commit c517b21
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions runbot_buildout/models/runbot_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def preexec():
return subprocess.Popen(
cmd, stdout=out, stderr=out, cwd=self._path(),
preexec_fn=preexec, close_fds=False,
env=self._get_buildout_environment(),
env=self._get_buildout_environment(log_build=True),
).pid

@api.multi
Expand Down Expand Up @@ -259,7 +259,7 @@ def _bootstrap_buildout(self, lock_path, log_path, delete_server=True):
)

@api.multi
def _get_buildout_environment(self):
def _get_buildout_environment(self, log_build=False):
self.ensure_one()
build_environment = dict(os.environ)
previous_build = self.search([
Expand All @@ -269,6 +269,12 @@ def _get_buildout_environment(self):
('id', '!=', self.id),
], order='create_date desc', limit=1)
if previous_build:
if log_build:
self._log(
'buildout',
'Using alternate objects from build #%(id)s' %
previous_build,
)
build_environment['GIT_ALTERNATE_OBJECT_DIRECTORIES'] = ':'.join([
':'.join(glob.glob(
previous_build._path('parts', '*', '.git', 'objects')
Expand Down

0 comments on commit c517b21

Please sign in to comment.