-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathinstall.py
56 lines (42 loc) · 1.9 KB
/
install.py
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
# grown-up modules
import compose.cli.command
import docker
import logging
import os
# local modules
from irods_testing_environment import archive
from irods_testing_environment import context
from irods_testing_environment import execute
from irods_testing_environment.install import install
from irods_testing_environment import services
if __name__ == "__main__":
import argparse
import textwrap
import cli
from irods_testing_environment import logs
parser = argparse.ArgumentParser(description='Install iRODS packages to a docker-compose project.')
cli.add_common_args(parser)
cli.add_compose_args(parser)
cli.add_irods_package_args(parser)
args = parser.parse_args()
if args.package_directory and args.package_version:
print('package directory and package version are mutually exclusive')
exit(1)
logs.configure(args.verbosity)
project_directory = os.path.abspath(args.project_directory or os.getcwd())
ctx = context.context(docker.from_env(),
compose.cli.command.get_project(
project_dir=project_directory,
project_name=args.project_name))
logging.debug('provided project name [{0}], docker-compose project name [{1}]'
.format(args.project_name, ctx.compose_project.name))
if len(ctx.compose_project.containers()) is 0:
logging.critical(
'no containers found for project [directory=[{0}], name=[{1}]]'.format(
os.path.abspath(project_directory), ctx.compose_project.name))
exit(1)
exit(install.make_installer(ctx.platform_name()).install_irods_packages(ctx,
externals_directory=args.irods_externals_package_directory,
package_directory=args.package_directory,
package_version=args.package_version)
)