mirror of
https://github.com/YunoHost/yunorunner.git
synced 2024-09-03 20:05:52 +02:00
[enh] allow to specify path to analyseCI.sh
This commit is contained in:
parent
a08df9fb03
commit
2289300908
1 changed files with 13 additions and 3 deletions
16
run.py
16
run.py
|
@ -138,9 +138,12 @@ async def run_job(worker, job):
|
|||
|
||||
# fake stupid command, whould run CI instead
|
||||
print(f"Starting job {job.name}...")
|
||||
command = await asyncio.create_subprocess_shell("/usr/bin/tail -n 100 /var/log/auth.log",
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.PIPE)
|
||||
|
||||
cwd = os.path.split(path_to_analyseCI)[0]
|
||||
command = await asyncio.create_subprocess_shell("/bin/bash " + path_to_analyseCI,
|
||||
cwd=cwd,
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.PIPE)
|
||||
|
||||
while not command.stdout.at_eof():
|
||||
data = await command.stdout.readline()
|
||||
|
@ -336,6 +339,13 @@ async def index(request):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if not sys.argv[1:]:
|
||||
print("Error: missing shell path argument")
|
||||
print("Usage: python run.py /path/to/analyseCI.sh")
|
||||
sys.exit(1)
|
||||
|
||||
path_to_analyseCI = sys.argv[1]
|
||||
|
||||
reset_pending_jobs()
|
||||
reset_busy_workers()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue