Add build scripts for ILO and IPMI management tools
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env python3
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
SCRIPT_DIR = Path(__file__).resolve().parent
|
||||
REPO_ROOT = SCRIPT_DIR.parents[1]
|
||||
ENTRYPOINT = REPO_ROOT / "personal" / "tools" / "ilo_powercycle.py"
|
||||
DIST_DIR = REPO_ROOT / "dist"
|
||||
|
||||
|
||||
def main():
|
||||
command = [
|
||||
sys.executable,
|
||||
"-m",
|
||||
"PyInstaller",
|
||||
"--noconfirm",
|
||||
"--clean",
|
||||
"--onefile",
|
||||
"--name",
|
||||
"ilo_powercycle",
|
||||
"--collect-submodules",
|
||||
"redfish",
|
||||
str(ENTRYPOINT),
|
||||
]
|
||||
|
||||
try:
|
||||
subprocess.run(command, cwd=REPO_ROOT, check=True)
|
||||
except subprocess.CalledProcessError as exc:
|
||||
raise SystemExit(exc.returncode) from exc
|
||||
|
||||
output_name = "ilo_powercycle.exe" if sys.platform.startswith("win") else "ilo_powercycle"
|
||||
output_path = DIST_DIR / output_name
|
||||
print(f"Built executable: {output_path}")
|
||||
print("Build once on each target OS to get a native executable for that platform.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user