MCPcopy Create free account
hub / github.com/apache/solr / main

Function main

dev-tools/scripts/releaseWizard.py:1318–1411  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1316
1317
1318def main():
1319 global state
1320 global dry_run
1321 global templates
1322
1323 print("Solr releaseWizard v%s" % getScriptVersion())
1324
1325 try:
1326 ConsoleMenu(clear_screen=True)
1327 except Exception as e:
1328 sys.exit("You need to install 'consolemenu' package version 0.7.1 for the Wizard to function. Please run 'pip "
1329 "install -r requirements.txt'")
1330
1331 c = parse_config()
1332
1333 if c.dry:
1334 print("Entering dry-run mode where all commands will be echoed instead of executed")
1335 dry_run = True
1336
1337 release_root = os.path.expanduser("~/.solr-releases")
1338 if not load_rc() or c.init:
1339 print("Initializing")
1340 root = str(input("Choose root folder: [~/.solr-releases] "))
1341 if os.path.exists(root) and (not os.path.isdir(root) or not os.access(root, os.W_OK)):
1342 sys.exit("Root %s exists but is not a directory or is not writable" % root)
1343 if not root == '':
1344 if root.startswith("~/"):
1345 release_root = os.path.expanduser(root)
1346 else:
1347 release_root = os.path.abspath(root)
1348 if not os.path.exists(release_root):
1349 try:
1350 print("Creating release root %s" % release_root)
1351 os.makedirs(release_root)
1352 except Exception as e:
1353 sys.exit("Error while creating %s: %s" % (release_root, e))
1354 release_version = get_release_version()
1355 else:
1356 conf = load_rc()
1357 release_root = conf['root']
1358 if 'release_version' in conf:
1359 release_version = conf['release_version']
1360 else:
1361 release_version = get_release_version()
1362 store_rc(release_root, release_version)
1363
1364 check_prerequisites()
1365
1366 try:
1367 y = yaml.load(open(os.path.join(script_path, "releaseWizard.yaml"), "r"), Loader=yaml.Loader)
1368 templates = y.get('templates')
1369 todo_list = y.get('groups')
1370 state = ReleaseState(release_root, release_version, getScriptVersion())
1371 state.init_todos(bootstrap_todos(todo_list))
1372 state.load()
1373 except Exception as e:
1374 sys.exit("Failed initializing. %s" % e)
1375

Callers 1

releaseWizard.pyFile · 0.70

Calls 15

loadMethod · 0.95
init_todosMethod · 0.95
saveMethod · 0.95
get_java_homeMethod · 0.95
get_java_cmdMethod · 0.95
getScriptVersionFunction · 0.85
load_rcFunction · 0.85
get_release_versionFunction · 0.85
store_rcFunction · 0.85
check_prerequisitesFunction · 0.85
ReleaseStateClass · 0.85
bootstrap_todosFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…