Browse Source

KAFKA-15200: Add pre-requisite check in release.py (#14636)

Reviewers: Divij Vaidya <diviv@amazon.com>
pull/14481/merge
Owen Leung 11 months ago committed by GitHub
parent
commit
9989b68d0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 29
      release.py

29
release.py

@ -491,6 +491,35 @@ Some of these may be used from these previous settings loaded from %s:
Do you have all of of these setup? (y/n): """ % (PREFS_FILE, json.dumps(prefs, indent=2))): Do you have all of of these setup? (y/n): """ % (PREFS_FILE, json.dumps(prefs, indent=2))):
fail("Please try again once you have all the prerequisites ready.") fail("Please try again once you have all the prerequisites ready.")
apache_id = sanitize_input("Please enter your apache-id: ")
print("Begin to check if you have met all the pre-requisites for the release process")
try:
test_maven = cmd_output("mvn -v")
if "Apache Maven" in test_maven:
print("Pre-requisite met: You have maven cli in place")
else:
fail("Pre-requisite not met: You need to install maven CLI")
except Exception as e:
fail(f"Pre-requisite not met: Unable to check if maven cli is installed. Error: {e}")
try:
test_sftp = subprocess.run(f"sftp {apache_id}@home.apache.org".split())
if test_sftp.returncode != 0:
fail("Pre-requisite not met: Cannot establish sftp connection. Please check your apache-id and ssh keys.")
print("Pre-requisite met: sftp connection is successful")
except Exception as e:
fail(f"Pre-requisite not met: Unable to check if sftp connection is successful. Error: {e}")
try:
test_svn = cmd_output("svn --version")
if "svn" in test_svn:
print("Pre-requisite met: You have svn cli in place")
else:
fail("Pre-requisite not met: You need to install svn cli")
except Exception as e:
fail(f"Pre-requisite not met: Unable to check if svn cli is installed. Error: {e}")
starting_branch = cmd_output('git rev-parse --abbrev-ref HEAD') starting_branch = cmd_output('git rev-parse --abbrev-ref HEAD')

Loading…
Cancel
Save