mirror of
https://github.com/blw1138/cross-py-builder.git
synced 2025-12-17 16:48:12 +00:00
Compare commits
3 Commits
80fdc887f0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b511962a1f | ||
|
|
e07e2bd997 | ||
|
|
3c92a0775f |
@@ -13,8 +13,8 @@ import requests
|
|||||||
from packaging.version import Version
|
from packaging.version import Version
|
||||||
from tabulate import tabulate
|
from tabulate import tabulate
|
||||||
|
|
||||||
from build_agent import build_agent_version
|
from .build_agent import build_agent_version
|
||||||
from zeroconf_server import ZeroconfServer
|
from .zeroconf_server import ZeroconfServer
|
||||||
|
|
||||||
DEFAULT_PORT = 9001
|
DEFAULT_PORT = 9001
|
||||||
TIMEOUT = 10
|
TIMEOUT = 10
|
||||||
@@ -32,9 +32,9 @@ def find_server_ips():
|
|||||||
ZeroconfServer.stop()
|
ZeroconfServer.stop()
|
||||||
|
|
||||||
# get known hosts
|
# get known hosts
|
||||||
with open("../known_hosts", "r") as file:
|
# with open("../known_hosts", "r") as file:
|
||||||
lines = file.readlines()
|
# lines = file.readlines()
|
||||||
hostnames.extend(lines)
|
# hostnames.extend(lines)
|
||||||
|
|
||||||
return hostnames
|
return hostnames
|
||||||
|
|
||||||
@@ -293,7 +293,7 @@ def restart_agent(hostname):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(description="Build agent manager for cross-py-builder")
|
parser = argparse.ArgumentParser(description="Build agent manager for cross_py_builder")
|
||||||
parser.add_argument("--status", action="store_true", help="Get status of available servers")
|
parser.add_argument("--status", action="store_true", help="Get status of available servers")
|
||||||
parser.add_argument("--build", type=str, help="Path to the project to build")
|
parser.add_argument("--build", type=str, help="Path to the project to build")
|
||||||
parser.add_argument("--checkout", type=str, help="Url to Git repo for checkout")
|
parser.add_argument("--checkout", type=str, help="Url to Git repo for checkout")
|
||||||
@@ -15,9 +15,9 @@ import glob
|
|||||||
import shutil
|
import shutil
|
||||||
import uuid
|
import uuid
|
||||||
import platform
|
import platform
|
||||||
from zeroconf_server import ZeroconfServer
|
from .zeroconf_server import ZeroconfServer
|
||||||
|
|
||||||
APP_NAME = "cross-py-builder"
|
APP_NAME = "cross_py_builder"
|
||||||
build_agent_version = "0.1.34"
|
build_agent_version = "0.1.34"
|
||||||
app_port = 9001
|
app_port = 9001
|
||||||
|
|
||||||
@@ -394,8 +394,7 @@ def delete_cache():
|
|||||||
return jsonify(job_cache()), 200
|
return jsonify(job_cache()), 200
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def main():
|
||||||
|
|
||||||
print(f"===== {APP_NAME} Build Agent (v{build_agent_version}) =====")
|
print(f"===== {APP_NAME} Build Agent (v{build_agent_version}) =====")
|
||||||
ZeroconfServer.configure("_crosspybuilder._tcp.local.", socket.gethostname(), app_port)
|
ZeroconfServer.configure("_crosspybuilder._tcp.local.", socket.gethostname(), app_port)
|
||||||
try:
|
try:
|
||||||
@@ -405,3 +404,6 @@ if __name__ == "__main__":
|
|||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
ZeroconfServer.stop()
|
ZeroconfServer.stop()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
6
setup.py
6
setup.py
@@ -1,14 +1,14 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="cross-py-builder",
|
name="cross_py_builder",
|
||||||
version="0.0.1",
|
version="0.0.1",
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
install_requires=open("requirements.txt").read().splitlines(),
|
install_requires=open("requirements.txt").read().splitlines(),
|
||||||
entry_points={
|
entry_points={
|
||||||
"console_scripts": [
|
"console_scripts": [
|
||||||
"cross-py-agent=cross-py-builder.build_agent:main",
|
"cross-py-agent=cross_py_builder.build_agent:main",
|
||||||
"cross-py-builder=cross-py-builder.agent_manager:main",
|
"cross-py-builder=cross_py_builder.agent_manager:main",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
author="Brett Williams",
|
author="Brett Williams",
|
||||||
|
|||||||
Reference in New Issue
Block a user