def deploy(environment, opts, profile):
target_name = opts['<STR_LIT>']<EOL>if target_name is None:<EOL><INDENT>target_name = environment.name<EOL><DEDENT>if not valid_deploy_name(target_name):<EOL><INDENT>raise DatacatsError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>.format(target_name=target_name))<EOL><DEDENT>if opts['<STR_LIT>']:<EOL><INDENT>profile.create(environment, target_name)<EOL><DEDENT>profile.deploy(environment, target_name, stdout)<EOL>print("<STR_LIT>".format(target_name))<EOL>if opts['<STR_LIT>']:<EOL><INDENT>try:<EOL><INDENT>pw = confirm_password()<EOL>profile.admin_password(environment, target_name, pw)<EOL><DEDENT>except KeyboardInterrupt:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>
Deploy environment to production DataCats.com cloud service

Usage:
  datacats deploy [--create] [ENVIRONMENT [TARGET_NAME]]

Options:
  --create                Create a new environment on DataCats.com instead
                          of updating an existing environment

ENVIRONMENT may be an environment name or a path to a environment directory.
Default: '.'

TARGET_NAME is the name of the environment on DataCats.com. Defaults to
the environment name.