Esempio n. 1
0
def push(args):
    infraboxcli.env.check_project_root(args)
    infraboxcli.env.check_env_cli_token(args)

    if not args.url:
        logger.error('either --url or INFRABOX_URL must be set')
        sys.exit(1)

    if not os.path.isdir(args.project_root):
        logger.error('%s does not exist or is not a directory' %
                     args.project_root)
        sys.exit(1)

    validate_infrabox_file(args)

    if args.validate_only:
        return

    zip_file = zipdir(args)
    result = upload_zip(args, zip_file)

    logger.info(result['url'])

    if args.show_console:
        show_console(result['build']['id'], args)
Esempio n. 2
0
File: push.py Progetto: metti/cli
def push(args):
    infraboxcli.env.check_env_cli_token(args)
    infraboxcli.env.check_env_project_id(args)

    if not os.path.isdir(args.project_root):
        logger.error('%s does not exist or is not a directory' %
                     args.project_root)
        sys.exit(1)

    validate_infrabox_json(args)

    if args.validate_only:
        return

    zip_file = zipdir(args)
    result = upload_zip(args, zip_file)

    if args.show_console:
        show_console(result['build']['id'], args)