mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-15 07:31:36 +01:00
Fix issue with stale cache from bad builds.
We always want to re-build packages we are revving, however, if the last build succeeds in building but fails tests, we have a bad local cache that has revved packages. This avoids this issue by working on all packages we are revving. Change-Id: I3bd7463a4090b1f007d09be81bdf65657bd9c3f3 BUG=7589 TEST=Ran it with cbuildbot. Review URL: http://codereview.chromium.org/3745006
This commit is contained in:
parent
f94950fb39
commit
365d4b0cc8
@ -345,6 +345,14 @@ def _UprevCleanup(buildroot, error_ok=False):
|
|||||||
'--tracking_branch="cros/master"', 'clean'],
|
'--tracking_branch="cros/master"', 'clean'],
|
||||||
cwd=cwd, error_ok=error_ok)
|
cwd=cwd, error_ok=error_ok)
|
||||||
|
|
||||||
|
workon_packages = RunCommand(['./cros_workon', 'list'],
|
||||||
|
enter_chroot=True, cwd=cwd, error_ok=error_ok,
|
||||||
|
redirect_stdout=True)
|
||||||
|
if workon_packages:
|
||||||
|
Info('Cleaning up workon packages %s' % workon_packages)
|
||||||
|
RunCommand(['./cros_workon', 'stop'] + workon_packages.split(),
|
||||||
|
enter_chroot=True, cwd=cwd, error_ok=False)
|
||||||
|
|
||||||
|
|
||||||
def _UprevPush(buildroot):
|
def _UprevPush(buildroot):
|
||||||
"""Pushes uprev changes to the main line."""
|
"""Pushes uprev changes to the main line."""
|
||||||
@ -439,7 +447,6 @@ def main():
|
|||||||
# Master bot needs to check if the other slaves completed.
|
# Master bot needs to check if the other slaves completed.
|
||||||
if cbuildbot_comm.HaveSlavesCompleted(config):
|
if cbuildbot_comm.HaveSlavesCompleted(config):
|
||||||
_UprevPush(buildroot)
|
_UprevPush(buildroot)
|
||||||
_UprevCleanup(buildroot)
|
|
||||||
else:
|
else:
|
||||||
# At least one of the slaves failed or we timed out.
|
# At least one of the slaves failed or we timed out.
|
||||||
_UprevCleanup(buildroot)
|
_UprevCleanup(buildroot)
|
||||||
@ -449,7 +456,7 @@ def main():
|
|||||||
if buildconfig['important']:
|
if buildconfig['important']:
|
||||||
cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_COMPLETE)
|
cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_COMPLETE)
|
||||||
|
|
||||||
_UprevCleanup(buildroot)
|
_UprevCleanup(buildroot)
|
||||||
except:
|
except:
|
||||||
# Send failure to master bot.
|
# Send failure to master bot.
|
||||||
if not buildconfig['master'] and buildconfig['important']:
|
if not buildconfig['master'] and buildconfig['important']:
|
||||||
|
|||||||
@ -99,6 +99,8 @@ if [ -n "${PACKAGE_LIST}" ] ; then
|
|||||||
./cros_mark_as_stable --board ${FLAGS_board} -p "${PACKAGE_LIST}" \
|
./cros_mark_as_stable --board ${FLAGS_board} -p "${PACKAGE_LIST}" \
|
||||||
-i "${COMMIT_ID_LIST}" -t ${FLAGS_tracking_branch} commit || \
|
-i "${COMMIT_ID_LIST}" -t ${FLAGS_tracking_branch} commit || \
|
||||||
die "Could not mark all packages as stable"
|
die "Could not mark all packages as stable"
|
||||||
|
|
||||||
|
./cros_workon start ${PACKAGE_LIST}
|
||||||
else
|
else
|
||||||
info "No candidate packages to be marked"
|
info "No candidate packages to be marked"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -123,7 +123,8 @@ def _PrintUsageAndDie(error_message=''):
|
|||||||
command_usage += ' %s: %s\n' % (command, _COMMAND_DICTIONARY[command])
|
command_usage += ' %s: %s\n' % (command, _COMMAND_DICTIONARY[command])
|
||||||
commands_str = '|'.join(commands)
|
commands_str = '|'.join(commands)
|
||||||
Warning('Usage: %s FLAGS [%s]\n\n%s\nFlags:%s' % (sys.argv[0], commands_str,
|
Warning('Usage: %s FLAGS [%s]\n\n%s\nFlags:%s' % (sys.argv[0], commands_str,
|
||||||
command_usage, gflags.FLAGS))
|
command_usage,
|
||||||
|
gflags.FLAGS))
|
||||||
if error_message:
|
if error_message:
|
||||||
Die(error_message)
|
Die(error_message)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user