mirror of
https://github.com/docker/compose.git
synced 2025-07-23 13:45:00 +02:00
Improve release automation
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
c2355175ea
commit
d469113b37
@ -78,10 +78,9 @@ def monitor_pr_status(pr_data):
|
|||||||
continue
|
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 summary['pending'] == 0 and summary['failure'] == 0 and summary['success'] > 0:
|
||||||
# Mostly for testing purposes against repos with no CI setup
|
# This check assumes at least 1 non-DCO CI check to avoid race conditions.
|
||||||
return True
|
# If testing on a repo without CI, use --skip-ci-check to avoid looping eternally
|
||||||
elif summary['pending'] == 0 and summary['failure'] == 0:
|
|
||||||
return True
|
return True
|
||||||
elif summary['failure'] > 0:
|
elif summary['failure'] > 0:
|
||||||
raise ScriptError('CI failures detected!')
|
raise ScriptError('CI failures detected!')
|
||||||
@ -156,6 +155,7 @@ def resume(args):
|
|||||||
if not pr_data:
|
if not pr_data:
|
||||||
pr_data = repository.create_release_pull_request(args.release)
|
pr_data = repository.create_release_pull_request(args.release)
|
||||||
check_pr_mergeable(pr_data)
|
check_pr_mergeable(pr_data)
|
||||||
|
if not args.skip_ci:
|
||||||
monitor_pr_status(pr_data)
|
monitor_pr_status(pr_data)
|
||||||
downloader = BinaryDownloader(args.destination)
|
downloader = BinaryDownloader(args.destination)
|
||||||
files = downloader.download_all(args.release)
|
files = downloader.download_all(args.release)
|
||||||
@ -195,6 +195,7 @@ def start(args):
|
|||||||
create_initial_branch(repository, args)
|
create_initial_branch(repository, args)
|
||||||
pr_data = repository.create_release_pull_request(args.release)
|
pr_data = repository.create_release_pull_request(args.release)
|
||||||
check_pr_mergeable(pr_data)
|
check_pr_mergeable(pr_data)
|
||||||
|
if not args.skip_ci:
|
||||||
monitor_pr_status(pr_data)
|
monitor_pr_status(pr_data)
|
||||||
downloader = BinaryDownloader(args.destination)
|
downloader = BinaryDownloader(args.destination)
|
||||||
files = downloader.download_all(args.release)
|
files = downloader.download_all(args.release)
|
||||||
@ -310,6 +311,10 @@ def main():
|
|||||||
'--no-cherries', '-C', dest='cherries', action='store_false',
|
'--no-cherries', '-C', dest='cherries', action='store_false',
|
||||||
help='If set, the program will not prompt the user for PR numbers to cherry-pick'
|
help='If set, the program will not prompt the user for PR numbers to cherry-pick'
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--skip-ci-checks', dest='skip_ci', action='store_true',
|
||||||
|
help='If set, the program will not wait for CI jobs to complete'
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.action == 'start':
|
if args.action == 'start':
|
||||||
|
@ -19,6 +19,7 @@ docker run -e GITHUB_TOKEN=$GITHUB_TOKEN -e BINTRAY_TOKEN=$BINTRAY_TOKEN -it \
|
|||||||
--mount type=bind,source=$(pwd),target=/src \
|
--mount type=bind,source=$(pwd),target=/src \
|
||||||
--mount type=bind,source=$(pwd)/.git,target=/src/.git \
|
--mount type=bind,source=$(pwd)/.git,target=/src/.git \
|
||||||
--mount type=bind,source=$HOME/.docker,target=/root/.docker \
|
--mount type=bind,source=$HOME/.docker,target=/root/.docker \
|
||||||
|
--mount type=bind,source=$HOME/.gitconfig,target=/root/.gitconfig
|
||||||
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
|
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
|
||||||
--mount type=bind,source=$HOME/.ssh,target=/root/.ssh \
|
--mount type=bind,source=$HOME/.ssh,target=/root/.ssh \
|
||||||
-v $HOME/.pypirc:/root/.pypirc \
|
-v $HOME/.pypirc:/root/.pypirc \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user