Config Env / Phases
This commit is contained in:
@@ -28,9 +28,17 @@ from rich.console import Console
|
||||
# CONFIGURATION - CREDENTIALS
|
||||
# ============================================================================
|
||||
|
||||
DEFAULT_USER_NAME = "admin"
|
||||
DEFAULT_PASSWORD = "+J3/rw..'ynxXDHwt?bAvn_>"
|
||||
REALME = "ziwig-pro"
|
||||
ENV = "pre-prod" # "prod" or "pre-prod"
|
||||
if "prod" in sys.argv:
|
||||
ENV = "prod"
|
||||
sys.argv.remove("prod")
|
||||
elif "pre-prod" in sys.argv:
|
||||
ENV = "pre-prod"
|
||||
sys.argv.remove("pre-prod")
|
||||
|
||||
DEFAULT_USER_NAME = "admin" if ENV == "prod" else "admin"
|
||||
DEFAULT_PASSWORD = "+J3/rw..'ynxXDHwt?bAvn_>" if ENV == "prod" else "123@Admin"
|
||||
REALME = "ziwig-pro" if ENV == "prod" else "ziwig-pro"
|
||||
|
||||
|
||||
# ============================================================================
|
||||
@@ -41,7 +49,7 @@ REALME = "ziwig-pro"
|
||||
MICROSERVICES = {
|
||||
"IAM": {
|
||||
"app_id": None, # IAM doesn't use app_id
|
||||
"base_url": "https://api-auth.ziwig-connect.com",
|
||||
"base_url": "https://api-auth.ziwig-connect.com" if ENV == "prod" else "https://api-iam.pp.ziwig-platform.com", # PRE-PROD
|
||||
"endpoints": {
|
||||
"login": "/api/auth/{REALME}/login", # POST : Body = {"username": "{user_name}", "password": "{pass}"}
|
||||
"refresh": "/api/auth/refreshToken", # POST : Body = {"refresh_token": "{refresh_token}"}
|
||||
@@ -75,8 +83,8 @@ MICROSERVICES = {
|
||||
# }
|
||||
# },
|
||||
"HRD": {
|
||||
"app_id": "93bc44fd-c64b-4fff-a450-f3cba956e934",
|
||||
"base_url": "https://api-resources.ziwig-connect.com",
|
||||
"app_id": "93bc44fd-c64b-4fff-a450-f3cba956e934" if ENV == "prod" else "234d72f1-509a-4e99-b2b9-ee12da1e336d",
|
||||
"base_url": "https://api-resources.ziwig-connect.com" if ENV == "prod" else "https://api-hrd.pp.ziwig-platform.com",
|
||||
"endpoints": {
|
||||
"config_token": "/api/auth/config-token", # POST : Body = {"userId": "{user_id}", "clientId": "{app_id}", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"}}
|
||||
"refresh": "/api/auth/refreshToken", # POST : Body = {"refresh_token": "{refresh_token}"}
|
||||
@@ -773,6 +781,19 @@ def main():
|
||||
"""
|
||||
global main_thread_pool, subtasks_thread_pool, number_of_threads
|
||||
|
||||
phase1 = True
|
||||
phase2 = True
|
||||
phase3 = True
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
if "1" not in sys.argv:
|
||||
phase1 = False
|
||||
if "2" not in sys.argv:
|
||||
phase2 = False
|
||||
if "3" not in sys.argv:
|
||||
phase3 = False
|
||||
|
||||
|
||||
# ========== AUTHENTICATION ==========
|
||||
print()
|
||||
login_status = login()
|
||||
@@ -786,7 +807,7 @@ def main():
|
||||
number_of_threads = int(
|
||||
questionary.text(
|
||||
"Number of threads:",
|
||||
default="12",
|
||||
default="5",
|
||||
validate=lambda x: x.isdigit() and 0 < int(x) <= MAX_THREADS
|
||||
).ask()
|
||||
)
|
||||
@@ -799,6 +820,7 @@ def main():
|
||||
init_subtasks_pool()
|
||||
|
||||
# ========== PHASE 1: ROLES ==========
|
||||
if phase1:
|
||||
print()
|
||||
console.print("==================================================")
|
||||
console.print("[bold cyan]PHASE 1: Processing Roles[/bold cyan]")
|
||||
@@ -831,6 +853,7 @@ def main():
|
||||
|
||||
|
||||
# ========== PHASE 2: APPLICATIONS ==========
|
||||
if phase2:
|
||||
print()
|
||||
console.print("==================================================")
|
||||
console.print("[bold cyan]PHASE 2: Processing Applications[/bold cyan]")
|
||||
@@ -892,6 +915,7 @@ def main():
|
||||
|
||||
|
||||
# ========== PHASE 3: ENDOBEST CENTERS ==========
|
||||
if phase3:
|
||||
process_endobest_centers()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user