~andrewjbeach/juju-ci-tools/get-juju-dict

« back to all changes in this revision

Viewing changes to run-deploy-job-wr.py

  • Committer: Aaron Bentley
  • Date: 2015-07-16 00:23:13 UTC
  • mto: This revision was merged to the branch mainline in revision 1028.
  • Revision ID: aaron.bentley@canonical.com-20150716002313-k3y4en43ifmcc5jc
Support running deploy jobs via workspace-runner

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
import json
 
3
import os
 
4
import subprocess
 
5
import sys
 
6
from tempfile import NamedTemporaryFile
 
7
 
 
8
def main():
 
9
    command = [
 
10
        '$HOME/juju-ci-tools/run-deploy-job-remote.bash',
 
11
        os.environ['revision_build'],
 
12
        os.environ['JOB_NAME'],
 
13
        ]
 
14
    command.extend(sys.argv[2:])
 
15
    with NamedTemporaryFile() as config_file:
 
16
        json.dump({'command': command, 'install': {}}, config_file)
 
17
        config_file.flush()
 
18
        subprocess.check_call(['workspace-run', config_file.name, sys.argv[1]])
 
19
 
 
20
if __name__ == '__main__':
 
21
    main()