14 lines
641 B
Python
14 lines
641 B
Python
#!/usr/bin/env python3
|
|
"""Publish the reviewed local agent source into the controller static release."""
|
|
import hashlib
|
|
import json
|
|
from pathlib import Path
|
|
import shutil
|
|
|
|
source = Path(__file__).resolve().parent
|
|
target = source.parent / "static" / "agent"
|
|
target.mkdir(parents=True, exist_ok=True)
|
|
shutil.copyfile(source / "ec_agent.py", target / "ec-agent.py")
|
|
shutil.copyfile(source / "install.sh", target / "install.sh")
|
|
(target / "manifest.json").write_text(json.dumps({"version": "1.1.0", "protocolVersion": 1, "platform": "debian-amd64", "sha256": hashlib.sha256((target / "ec-agent.py").read_bytes()).hexdigest()}, indent=2) + "\n")
|