call into the rendering-task to deploy the tasks onto the cubes after rendering

This commit is contained in:
MaZderMind 2014-07-23 23:24:39 +02:00
parent d11886698a
commit a8e0fc7da2
3 changed files with 16 additions and 0 deletions

View file

@ -1,5 +1,6 @@
#!/usr/bin/python3
import subprocess
from renderlib import *
# URL to Schedule-XML
@ -198,3 +199,8 @@ def ticket(ticket):
'$personnames': ticket.get('Fahrplan.Person_list')
}
)
def deploy(ticket, task):
for encoder in range(1, 6):
print("encoder{n}".format(n=encoder))
subprocess.check_call('rsync -v --bwlimit=1000 --progress -e="ssh -A voc@gw.ep14.c3voc.de ssh -A voc@encoder{n}.lan.c3voc.de" {file} :{file}'.format(n=encoder, file=task.outfile), shell=True)

View file

@ -1,5 +1,6 @@
#!/usr/bin/python
import subprocess
from renderlib import *
# URL to Schedule-XML
@ -99,3 +100,8 @@ def ticket(ticket):
'$personnames': ticket.get('Fahrplan.Person_list')
}
)
def deploy(ticket, task):
for encoder in range(1, 3):
print("encoder{n}".format(n=encoder))
subprocess.check_call('rsync -v --bwlimit=1000 --progress -e="ssh -A voc@gw.ep14.c3voc.de ssh -A voc@encoder{n}.lan.c3voc.de" {file} :/tmp/'.format(n=encoder, file=task.outfile), shell=True)

View file

@ -40,6 +40,10 @@ def generatePreroll(ticket):
task.workdir = os.path.join(os.getcwd(), projectname, 'artwork')
renderlib.rendertask(task)
if hasattr(project, 'deploy'):
print("deploying")
project.deploy(ticket, task)
while True:
print('Asking RPC for {0}-tickets which are ready for state {1}'.format(ticket_type, ticket_state))