Skip to content

Commit 9989b68

Browse files
KAFKA-15200: Add pre-requisite check in release.py (apache#14636)
Reviewers: Divij Vaidya <[email protected]>
1 parent abd104a commit 9989b68

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

release.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,35 @@ def command_release_announcement_email():
491491
Do you have all of of these setup? (y/n): """ % (PREFS_FILE, json.dumps(prefs, indent=2))):
492492
fail("Please try again once you have all the prerequisites ready.")
493493

494+
apache_id = sanitize_input("Please enter your apache-id: ")
495+
496+
print("Begin to check if you have met all the pre-requisites for the release process")
497+
498+
try:
499+
test_maven = cmd_output("mvn -v")
500+
if "Apache Maven" in test_maven:
501+
print("Pre-requisite met: You have maven cli in place")
502+
else:
503+
fail("Pre-requisite not met: You need to install maven CLI")
504+
except Exception as e:
505+
fail(f"Pre-requisite not met: Unable to check if maven cli is installed. Error: {e}")
506+
507+
try:
508+
test_sftp = subprocess.run(f"sftp {apache_id}@home.apache.org".split())
509+
if test_sftp.returncode != 0:
510+
fail("Pre-requisite not met: Cannot establish sftp connection. Please check your apache-id and ssh keys.")
511+
print("Pre-requisite met: sftp connection is successful")
512+
except Exception as e:
513+
fail(f"Pre-requisite not met: Unable to check if sftp connection is successful. Error: {e}")
514+
515+
try:
516+
test_svn = cmd_output("svn --version")
517+
if "svn" in test_svn:
518+
print("Pre-requisite met: You have svn cli in place")
519+
else:
520+
fail("Pre-requisite not met: You need to install svn cli")
521+
except Exception as e:
522+
fail(f"Pre-requisite not met: Unable to check if svn cli is installed. Error: {e}")
494523

495524
starting_branch = cmd_output('git rev-parse --abbrev-ref HEAD')
496525

0 commit comments

Comments
 (0)