Ejemplo n.º 1
0
def deploy():
    parser = argparse.ArgumentParser(description='Deploy documents')
    parser.add_argument('commands', nargs='+', choices=commands)
    parser.add_argument('--s3', help='s3 bucket')
    args = parser.parse_args(sys.argv[2:])
    config = Config()
    if args.s3:
        config.deploy['s3_bucket'] = args.s3
    if config.deploy['s3_bucket']:
        deployer = S3Deployer(config)
    elif config.deploy['github_repo']:
        deployer = GithubDeployer(config)
    else:
        deployer = Deployer(config)
    for cmd in args.commands:
        getattr(deployer, cmd)()
Ejemplo n.º 2
0
def build():
    parser = argparse.ArgumentParser(description='Build the documents')
    parser.add_argument('commands', nargs='+', choices=commands)
    args = parser.parse_args(sys.argv[2:])
    config = Config()
    builder = Builder(config)
    for cmd in args.commands:
        getattr(builder, cmd)()
Ejemplo n.º 3
0
def deploy():
    parser = argparse.ArgumentParser(description='Deploy documents')
    parser.add_argument('commands', nargs='+', choices=commands)
    args = parser.parse_args(sys.argv[2:])
    config = Config()
    deployer = Deployer(config)
    for cmd in args.commands:
        getattr(deployer, cmd)()
Ejemplo n.º 4
0
def deploy():
    parser = argparse.ArgumentParser(description='Deploy documents')
    parser.add_argument('commands', nargs='+', choices=commands)
    parser.add_argument('--s3', help='s3 bucket')
    args = parser.parse_args(sys.argv[2:])
    config = Config()
    if args.s3:
        config.deploy['s3_bucket'] = args.s3
    if config.deploy['s3_bucket']:
        deployer = S3Deployer(config)
    elif config.deploy['github_repo']:
        deployer = GithubDeployer(config)
    else:
        logging.fatal('No deployment URL. You need to specify either'
                      'a Github repo or a S3 bucket')
        exit(-1)
    for cmd in args.commands:
        getattr(deployer, cmd)()
Ejemplo n.º 5
0
def build():
    parser = argparse.ArgumentParser(description='Build the documents')
    parser.add_argument('commands', nargs='+', choices=commands)
    parser.add_argument('--tab', default=None, help='The tab to build, if multi-tab is enabled.')
    args = parser.parse_args(sys.argv[2:])
    config = Config(tab=args.tab)
    builder = Builder(config)
    for cmd in args.commands:
        getattr(builder, cmd)()
Ejemplo n.º 6
0
def build():
    parser = argparse.ArgumentParser(description='Build the documents')
    parser.add_argument('commands', nargs='+', choices=commands)
    parser.add_argument('--tab',
                        default=None,
                        help='The tab to build, if multi-tab is enabled.')
    parser.add_argument(
        '--timeout',
        type=int,
        default=1200,
        help=
        "Timeout for excution. Default: 1200 (s). Set timeout -1 to disable timeout."
    )
    args = parser.parse_args(sys.argv[2:])
    config = Config(tab=args.tab)
    timeout = args.timeout
    builder = Builder(config, timeout)
    for cmd in args.commands:
        getattr(builder, cmd)()
Ejemplo n.º 7
0
def clear():
    config = Config()
    build_dir = config.tgt_dir
    logging.info('Delete %s', build_dir)
    shutil.rmtree(build_dir, ignore_errors=True)