Add build scripts for ILO and IPMI management tools

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-26 10:18:04 -04:00
parent 31b01c5c0c
commit 32d027fcc9
7 changed files with 238 additions and 2 deletions
+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/env python3
import subprocess
import sys
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parent
CRON_SCRIPTS = REPO_ROOT / "personal" / "cron_scripts"
BUILD_SCRIPTS = [
CRON_SCRIPTS / "build_multi_powercycle.py",
CRON_SCRIPTS / "build_set_fanspeed.py",
CRON_SCRIPTS / "build_ilo_status.py",
CRON_SCRIPTS / "build_ilo_powercycle.py",
CRON_SCRIPTS / "build_ipmi_poweron.py",
CRON_SCRIPTS / "build_ipmi_poweroff.py",
]
def main():
failures = []
for script in BUILD_SCRIPTS:
print(f"\n{'='*60}")
print(f"Building: {script.name}")
print(f"{'='*60}")
result = subprocess.run([sys.executable, str(script)], cwd=REPO_ROOT)
if result.returncode != 0:
failures.append(script.name)
print(f"\n{'='*60}")
if failures:
print(f"FAILED builds ({len(failures)}/{len(BUILD_SCRIPTS)}):")
for name in failures:
print(f" - {name}")
raise SystemExit(1)
else:
print(f"All {len(BUILD_SCRIPTS)} builds completed successfully.")
print(f"Executables are in: {REPO_ROOT / 'dist'}")
if __name__ == "__main__":
main()
@@ -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()
+40
View File
@@ -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 = SCRIPT_DIR / "ilo_status.py"
DIST_DIR = REPO_ROOT / "dist"
def main():
command = [
sys.executable,
"-m",
"PyInstaller",
"--noconfirm",
"--clean",
"--onefile",
"--name",
"ilo_status",
"--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_status.exe" if sys.platform.startswith("win") else "ilo_status"
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()
@@ -0,0 +1,38 @@
#!/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 = SCRIPT_DIR / "power" / "ipmi_poweroff.py"
DIST_DIR = REPO_ROOT / "dist"
def main():
command = [
sys.executable,
"-m",
"PyInstaller",
"--noconfirm",
"--clean",
"--onefile",
"--name",
"ipmi_poweroff",
str(ENTRYPOINT),
]
try:
subprocess.run(command, cwd=REPO_ROOT, check=True)
except subprocess.CalledProcessError as exc:
raise SystemExit(exc.returncode) from exc
output_name = "ipmi_poweroff.exe" if sys.platform.startswith("win") else "ipmi_poweroff"
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()
@@ -0,0 +1,38 @@
#!/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 = SCRIPT_DIR / "power" / "ipmi_poweron.py"
DIST_DIR = REPO_ROOT / "dist"
def main():
command = [
sys.executable,
"-m",
"PyInstaller",
"--noconfirm",
"--clean",
"--onefile",
"--name",
"ipmi_poweron",
str(ENTRYPOINT),
]
try:
subprocess.run(command, cwd=REPO_ROOT, check=True)
except subprocess.CalledProcessError as exc:
raise SystemExit(exc.returncode) from exc
output_name = "ipmi_poweron.exe" if sys.platform.startswith("win") else "ipmi_poweron"
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()
@@ -5,8 +5,9 @@ from pathlib import Path
SCRIPT_DIR = Path(__file__).resolve().parent SCRIPT_DIR = Path(__file__).resolve().parent
REPO_ROOT = SCRIPT_DIR.parents[1]
ENTRYPOINT = SCRIPT_DIR / "multi_powercycle.py" ENTRYPOINT = SCRIPT_DIR / "multi_powercycle.py"
DIST_DIR = SCRIPT_DIR / "dist" DIST_DIR = REPO_ROOT / "dist"
def main(): def main():
@@ -25,7 +26,7 @@ def main():
] ]
try: try:
subprocess.run(command, cwd=SCRIPT_DIR, check=True) subprocess.run(command, cwd=REPO_ROOT, check=True)
except subprocess.CalledProcessError as exc: except subprocess.CalledProcessError as exc:
raise SystemExit(exc.returncode) from exc raise SystemExit(exc.returncode) from exc
@@ -0,0 +1,38 @@
#!/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 = SCRIPT_DIR / "fancontrol" / "set_fanspeed.py"
DIST_DIR = REPO_ROOT / "dist"
def main():
command = [
sys.executable,
"-m",
"PyInstaller",
"--noconfirm",
"--clean",
"--onefile",
"--name",
"set_fanspeed",
str(ENTRYPOINT),
]
try:
subprocess.run(command, cwd=REPO_ROOT, check=True)
except subprocess.CalledProcessError as exc:
raise SystemExit(exc.returncode) from exc
output_name = "set_fanspeed.exe" if sys.platform.startswith("win") else "set_fanspeed"
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()