mirror of
https://github.com/docker/compose.git
synced 2025-07-21 12:44:54 +02:00
Improve monitor function
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
87b8eaa27c
commit
28f7f79fea
@ -66,24 +66,29 @@ def monitor_pr_status(pr_data):
|
|||||||
last_commit = pr_data.get_commits().reversed[0]
|
last_commit = pr_data.get_commits().reversed[0]
|
||||||
while True:
|
while True:
|
||||||
status = last_commit.get_combined_status()
|
status = last_commit.get_combined_status()
|
||||||
if status.state == 'pending':
|
if status.state == 'pending' or status.state == 'failure':
|
||||||
summary = {
|
summary = {
|
||||||
'pending': 0,
|
'pending': 0,
|
||||||
'success': 0,
|
'success': 0,
|
||||||
'failure': 0,
|
'failure': 0,
|
||||||
}
|
}
|
||||||
for detail in status.statuses:
|
for detail in status.statuses:
|
||||||
|
if detail.context == 'dco-signed':
|
||||||
|
# dco-signed check breaks on merge remote-tracking ; ignore it
|
||||||
|
continue
|
||||||
summary[detail.state] += 1
|
summary[detail.state] += 1
|
||||||
print('{pending} pending, {success} successes, {failure} failures'.format(**summary))
|
print('{pending} pending, {success} successes, {failure} failures'.format(**summary))
|
||||||
if status.total_count == 0:
|
if status.total_count == 0:
|
||||||
# Mostly for testing purposes against repos with no CI setup
|
# Mostly for testing purposes against repos with no CI setup
|
||||||
return True
|
return True
|
||||||
|
elif summary['pending'] == 0 and summary['failure'] == 0:
|
||||||
|
return True
|
||||||
|
elif summary['failure'] > 0:
|
||||||
|
raise ScriptError('CI failures detected!')
|
||||||
time.sleep(30)
|
time.sleep(30)
|
||||||
elif status.state == 'success':
|
elif status.state == 'success':
|
||||||
print('{} successes: all clear!'.format(status.total_count))
|
print('{} successes: all clear!'.format(status.total_count))
|
||||||
return True
|
return True
|
||||||
else:
|
|
||||||
raise ScriptError('CI failure detected')
|
|
||||||
|
|
||||||
|
|
||||||
def check_pr_mergeable(pr_data):
|
def check_pr_mergeable(pr_data):
|
||||||
@ -159,7 +164,7 @@ def resume(args):
|
|||||||
delete_assets(gh_release)
|
delete_assets(gh_release)
|
||||||
upload_assets(gh_release, files)
|
upload_assets(gh_release, files)
|
||||||
img_manager = ImageManager(args.release)
|
img_manager = ImageManager(args.release)
|
||||||
img_manager.build_images(repository, files, args.release)
|
img_manager.build_images(repository, files)
|
||||||
except ScriptError as e:
|
except ScriptError as e:
|
||||||
print(e)
|
print(e)
|
||||||
return 1
|
return 1
|
||||||
|
@ -36,7 +36,7 @@ class BinaryDownloader(requests.Session):
|
|||||||
base=self.base_appveyor_url, filename=filename, branch_name=branch_name
|
base=self.base_appveyor_url, filename=filename, branch_name=branch_name
|
||||||
)
|
)
|
||||||
full_dest = os.path.join(REPO_ROOT, self.destination, filename)
|
full_dest = os.path.join(REPO_ROOT, self.destination, filename)
|
||||||
return self.download(url, full_dest)
|
return self._download(url, full_dest)
|
||||||
|
|
||||||
def _download(self, url, full_dest):
|
def _download(self, url, full_dest):
|
||||||
m = hashlib.sha256()
|
m = hashlib.sha256()
|
||||||
@ -57,7 +57,7 @@ class BinaryDownloader(requests.Session):
|
|||||||
files = {
|
files = {
|
||||||
'docker-compose-Darwin-x86_64': None,
|
'docker-compose-Darwin-x86_64': None,
|
||||||
'docker-compose-Linux-x86_64': None,
|
'docker-compose-Linux-x86_64': None,
|
||||||
# 'docker-compose-Windows-x86_64.exe': None,
|
'docker-compose-Windows-x86_64.exe': None,
|
||||||
}
|
}
|
||||||
|
|
||||||
for filename in files.keys():
|
for filename in files.keys():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user