forked from mozilla/version-control-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-environment
executable file
·71 lines (53 loc) · 1.97 KB
/
create-environment
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env python2.7
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import argparse
import os
import sys
HERE = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(HERE, 'testing'))
from vcttesting.environment import (
create_docs,
create_hgdev,
create_vcssync,
create_xchannel,
)
def main():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(title='environment', dest='environment')
sp = subparsers.add_parser('docs',
help='Generate documentation')
sp = subparsers.add_parser('hgdev',
help='Mercurial hooks and extensions')
sp.add_argument('--docker-bmo', action='store_true',
help='Enable Docker support for bugzilla.mozilla.org')
sp = subparsers.add_parser('vcssync',
help='Version control synchronization')
sp = subparsers.add_parser('xchannel',
help='Cross-channel Localization')
args = parser.parse_args()
env = args.environment
if env == 'docs':
info = create_docs()
elif env == 'hgdev':
info = create_hgdev(docker_bmo=args.docker_bmo)
elif env == 'vcssync':
info = create_vcssync()
elif env == 'xchannel':
info = create_xchannel()
else:
raise Exception('unhandled environment: %s' % env)
print('%s environment created successfully.' % env)
print('')
print('To activate this environment, source a shell script:')
print('')
print(' $ source %s' % os.path.relpath(info['activate'], HERE))
print('')
print('To update the environment, just run this command again.')
print('')
print('To run tests relevant to this environment:')
print('')
print(' $ ./run-tests')
if __name__ == '__main__':
main()