소스 검색

Remove temporary scripts

DevOps Team 2 달 전
부모
커밋
1db1e8c377
2개의 변경된 파일0개의 추가작업 그리고 101개의 파일을 삭제
  1. 0 55
      add_dubbo_ports.py
  2. 0 46
      check_dubbo_ports.py

+ 0 - 55
add_dubbo_ports.py

@@ -1,55 +0,0 @@
-#!/usr/bin/env python3
-import yaml
-from pathlib import Path
-
-repo_root = Path("d:/coding-area/devops/deploy/microservice-helm")
-chart_base = repo_root / "charts"
-
-# Dubbo services mapping
-dubbo_services = {
-    'shop-recycle-account': 2030,
-    'shop-recycle-data-statistics': 2028,
-    'shop-recycle-dealdata-service': 2032,
-    'shop-recycle-dispatcher': 2033,
-    'shop-recycle-merchant': 2023,
-    'shop-recycle-msg': 2026,
-    'shop-recycle-order-center': 2022,
-    'shop-recycle-order-search': 2034,
-    'shop-recycle-payment': 2027,
-    'shop-recycle-pis': 2025,
-    'shop-recycle-platform': 2021,
-    'shop-recycle-store': 2024,
-    'shop-recycle-wechat': 2031,
-}
-
-print("为Dubbo服务添加dubbo_port配置...\n")
-
-for service_name, dubbo_port in dubbo_services.items():
-    values_path = chart_base / service_name / "values.yaml"
-    
-    if not values_path.exists():
-        print(f"WARNING: {service_name} values.yaml not found")
-        continue
-    
-    try:
-        with open(values_path, 'r', encoding='utf-8') as f:
-            values = yaml.safe_load(f)
-    except Exception as e:
-        print(f"ERROR reading {service_name}: {e}")
-        continue
-    
-    # Add dubbo_port to service section
-    if 'service' not in values:
-        values['service'] = {}
-    
-    values['service']['dubbo_port'] = dubbo_port
-    
-    # Write back
-    try:
-        with open(values_path, 'w', encoding='utf-8') as f:
-            yaml.dump(values, f, default_flow_style=False, allow_unicode=True, sort_keys=False)
-        print(f"✓ {service_name}: 添加dubbo_port: {dubbo_port}")
-    except Exception as e:
-        print(f"ERROR writing {service_name}: {e}")
-
-print("\n所有Dubbo服务配置完成!")

+ 0 - 46
check_dubbo_ports.py

@@ -1,46 +0,0 @@
-#!/usr/bin/env python3
-import yaml
-from pathlib import Path
-
-repo_root = Path("d:/coding-area/devops/deploy/microservice-helm")
-chart_base = repo_root / "charts"
-
-# Get all service directories
-services = sorted([d.name for d in chart_base.iterdir() if d.is_dir() and d.name != "base"])
-
-dubbo_services = {}
-
-for service_name in services:
-    values_path = chart_base / service_name / "values.yaml"
-    
-    if not values_path.exists():
-        continue
-    
-    try:
-        with open(values_path, 'r', encoding='utf-8') as f:
-            values = yaml.safe_load(f)
-    except Exception as e:
-        print(f"ERROR reading {service_name}: {e}")
-        continue
-    
-    # Check if service has dubbo configuration
-    if values and 'config' in values and 'yml' in values['config']:
-        config_yml = values['config']['yml']
-        
-        # Look for dubbo protocol port
-        if 'dubbo' in config_yml and 'protocol' in config_yml['dubbo']:
-            protocol = config_yml['dubbo']['protocol']
-            if 'port' in protocol:
-                dubbo_port = protocol['port']
-                http_port = values['service']['port']
-                dubbo_services[service_name] = {
-                    'http_port': http_port,
-                    'dubbo_port': dubbo_port
-                }
-
-print(f"发现 {len(dubbo_services)} 个Dubbo服务:\n")
-for service_name in sorted(dubbo_services.keys()):
-    info = dubbo_services[service_name]
-    print(f"{service_name}:")
-    print(f"  HTTP Port: {info['http_port']}")
-    print(f"  Dubbo Port: {info['dubbo_port']}")