OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 The Swarming Authors. All rights reserved. | 2 # Copyright 2013 The LUCI Authors. All rights reserved. |
3 # Use of this source code is governed under the Apache License, Version 2.0 that | 3 # Use of this source code is governed by the Apache v2.0 license that can be |
4 # can be found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Converts run_isolated.py with dependencies into run_isolated.zip. | 6 """Converts run_isolated.py with dependencies into run_isolated.zip. |
7 | 7 |
8 run_isolated.zip will be created in the current directory. | 8 run_isolated.zip will be created in the current directory. |
9 | 9 |
10 Useful for reproducing swarm-bot environment like this: | 10 Useful for reproducing swarm-bot environment like this: |
11 ./tools/zip_run_isolated.py && python run_isolated.zip ... | 11 ./tools/zip_run_isolated.py && python run_isolated.zip ... |
12 """ | 12 """ |
13 | 13 |
14 import os | 14 import os |
15 import sys | 15 import sys |
16 | 16 |
17 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 17 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
18 sys.path.insert(0, ROOT_DIR) | 18 sys.path.insert(0, ROOT_DIR) |
19 | 19 |
20 import run_isolated | 20 import run_isolated |
21 | 21 |
22 | 22 |
23 def main(): | 23 def main(): |
24 zip_package = run_isolated.get_as_zip_package() | 24 zip_package = run_isolated.get_as_zip_package() |
25 zip_package.zip_into_file('run_isolated.zip') | 25 zip_package.zip_into_file('run_isolated.zip') |
26 return 0 | 26 return 0 |
27 | 27 |
28 | 28 |
29 if __name__ == '__main__': | 29 if __name__ == '__main__': |
30 sys.exit(main()) | 30 sys.exit(main()) |
OLD | NEW |