Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+104
@@ -0,0 +1,104 @@
|
||||
from prompt_toolkit import prompt
|
||||
import concurrent.futures
|
||||
import network
|
||||
import settings
|
||||
import local
|
||||
from rich.table import Table
|
||||
from rich.console import Console
|
||||
def switch_branch(verbose):
|
||||
|
||||
tds = settings.get_setting("tds")
|
||||
tds_user = settings.get_setting("tds_user")
|
||||
tds_pass = settings.get_setting("tds_pass")
|
||||
branches_list = network.list_branches(tds, tds_user, tds_pass)
|
||||
|
||||
table = Table(title="Branches")
|
||||
table.add_column("Branches")
|
||||
for branch in branches_list:
|
||||
table.add_row(branch)
|
||||
branch_name = prompt('Branch name:')
|
||||
if branch_name not in branches_list:
|
||||
print("choose branch from the list!")
|
||||
switch_branch(verbose)
|
||||
|
||||
|
||||
def add_branch(verbose):
|
||||
localhost = False
|
||||
|
||||
tds = settings.get_setting("tds")
|
||||
if tds == "localhost":
|
||||
localhost = True
|
||||
tds_user = settings.get_setting("tds_user")
|
||||
tds_pass = settings.get_setting("tds_pass")
|
||||
dbs = settings.get_setting("dbs")
|
||||
|
||||
dbs_user = settings.get_setting("dbs_user")
|
||||
dbs_pass = settings.get_setting("dbs_pass")
|
||||
|
||||
|
||||
branch_url = prompt('SVN URL:')
|
||||
project_name_p= prompt("Project Name(y/n)(Standard is guez):")
|
||||
project_name = "guez"
|
||||
guez_mode= True
|
||||
build_ws= True
|
||||
build_sv= True
|
||||
build_hla= False
|
||||
|
||||
if prompt("GÜZ Mode(y/n)(Standard is ON):") == "n":
|
||||
guez_mode = False
|
||||
|
||||
if prompt("Build WS(y/n)(Standard is ON):") == "n":
|
||||
build_ws = False
|
||||
|
||||
if prompt("Build SV(y/n)(Standard is ON):") == "n":
|
||||
build_sv = False
|
||||
|
||||
if prompt("Build HLA(y/n)(Standard is OFF):") == "y":
|
||||
build_hla=True
|
||||
|
||||
if project_name_p != "":
|
||||
project_name=project_name_p
|
||||
|
||||
console = Console()
|
||||
with console.status("[bold green]Adding branch..."):
|
||||
with concurrent.futures.ProcessPoolExecutor() as executor:
|
||||
|
||||
if not localhost:
|
||||
branch_name = network.add_branch(tds, tds_user, tds_pass, branch_url)
|
||||
console.log("Adding Folders on Server and SVN Checkout complete.")
|
||||
executor.submit(build_remote(tds, tds_user, tds_pass, branch_name, project_name, guez_mode, build_ws, build_sv, build_hla))
|
||||
console.log("Building on Server complete.(SRC and Test-DB)")
|
||||
|
||||
branch_name = local.add_branch(branch_url)
|
||||
if branch_name:
|
||||
console.log("Adding Folders on local machine and SVN Checkout complete.")
|
||||
else:
|
||||
return
|
||||
if executor.submit(build_local(project_name, guez_mode, build_ws, build_sv, build_hla, branch_name)):
|
||||
console.log("Building on local machine complete.")
|
||||
else:
|
||||
return
|
||||
|
||||
|
||||
if not localhost:
|
||||
db_name = network.checkLtsccConf(tds, tds_user, tds_pass, "DatabaseName")
|
||||
network.save_db(dbs, dbs_user, dbs_pass, db_name, verbose)
|
||||
|
||||
console.log("Saving old db complete.")
|
||||
|
||||
network.editLtsccConf(tds, tds_user, tds_pass, "DatabaseName", f'{branch_name}_db')
|
||||
console.log("Editing new DB to lts-cc.conf complete.")
|
||||
|
||||
|
||||
console.log("Build Test DB complete.")
|
||||
settings.set_setting("current_branch", branch_name)
|
||||
|
||||
|
||||
|
||||
|
||||
def build_remote(tds, tds_user, tds_pass, branch_name, project_name, guez_mode, build_ws, build_sv, build_hla):
|
||||
network.build_branch(tds, tds_user, tds_pass, branch_name, project_name, guez_mode, build_ws, build_sv, build_hla)
|
||||
network.build_test_db(tds,tds_user,tds_pass, branch_name)
|
||||
|
||||
def build_local(project_name, guez_mode, build_ws, build_sv, build_hla, branch_name):
|
||||
local.build_branch(branch_name, project_name, guez_mode, build_ws, build_sv, build_hla)
|
||||
Reference in new issue
Block a user