[IMP] runbot: log latest commit hash and message when server is built

When a server is built based on dependency_ids, only the branch refs was
logged. In this situation, it's difficult to reproduce a build locally
in the exact same conditions.

With this commit, the latest commit hash and message of this
branch is also logged.
This commit is contained in:
Christophe Monniez 2018-04-20 10:37:52 +02:00
parent 0cb07e73db
commit 12542808a9

View File

@ -514,6 +514,12 @@ class runbot_build(models.Model):
'Building environment',
'%s match branch %s of %s' % (server_match, closest_name, repo.name)
)
latest_commit = repo._git(['rev-parse', closest_name]).strip()
commit_oneline = repo._git(['show', '--pretty="%H -- %s"', '-s', latest_commit]).strip()
build._log(
'Building environment',
'Server built based on commit %s from %s' % (commit_oneline, closest_name)
)
repo._git_export(closest_name, build._path())
# Finally mark all addons to move to openerp/addons