From a8e0fc7da208b624856f9a61743fc77177dc63fd Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Wed, 23 Jul 2014 23:24:39 +0200 Subject: [PATCH] call into the rendering-task to deploy the tasks onto the cubes after rendering --- fossgis14/__init__.py | 6 ++++++ pycon14/__init__.py | 6 ++++++ script-Z-preroll-generator.py | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/fossgis14/__init__.py b/fossgis14/__init__.py index 8c757d6..ea9a737 100644 --- a/fossgis14/__init__.py +++ b/fossgis14/__init__.py @@ -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) diff --git a/pycon14/__init__.py b/pycon14/__init__.py index 07b3a92..66753dc 100644 --- a/pycon14/__init__.py +++ b/pycon14/__init__.py @@ -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) diff --git a/script-Z-preroll-generator.py b/script-Z-preroll-generator.py index 8c2efbf..5a6297c 100755 --- a/script-Z-preroll-generator.py +++ b/script-Z-preroll-generator.py @@ -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))