Example #1
0
def interactive_options(options):
    print "Warning: This script is meant to be run as root and will make changes to the configuration of the machine it is run on."
    resp = raw_input("Are you sure you want to continue (yes/no)? [no] ")
    sys_update = options.update_system
    options.update_system = get_choice(
        "Update and upgrade system before rest of setup?",
        options.update_system)
    if resp != "yes":
        sys.exit(1)
    pkg_only = get_choice("Only install packages, do no additional setup?")
    options.packages_only = pkg_only
    if pkg_only:
        print "Only system packages will be installed, no further setup will be done."
        return
    user = options.username
    user = raw_input("Contest username? [%s] " % (user, ))
    options.username = user if user else options.username
    root_dir = options.root_dir
    root_dir = raw_input("Contest root directory? [%s] " % (root_dir, ))
    options.root_dir = root_dir if root_dir else options.root_dir
    repo_dir = options.local_repo
    repo_dir = raw_input("Directory of source repository? [%s] " %
                         (repo_dir, ))
    options.local_repo = repo_dir if repo_dir else options.local_repo
    base_url = options.api_url
    base_url = raw_input("API Base url? [%s] " % (base_url, ))
    options.api_url = base_url if base_url else options.api_url
    api_key = options.api_key
    api_key = raw_input("Worker API key? [%s] " % (api_key, ))
    options.api_key = api_key if api_key else options.api_key
    options.install_cronjobs = get_choice("Install startup cronjob?",
                                          options.install_cronjobs)
    options.run_worker = get_choice(
        "Immediately run worker start script at end of setup?",
        options.run_worker)
Example #2
0
def interactive_options(options):
    print "Warning: This script is meant to be run as root and will make changes to the configuration of the machine it is run on."
    resp = raw_input("Are you sure you want to continue (yes/no)? [no] ")
    if resp != "yes":
        sys.exit(1)
    pkg_only = get_choice("Only install system packages?")
    options.packages_only = pkg_only
    if pkg_only:
        print "Only system packages will be installed, no further setup will be done."
        return
    user = options.username
    user = raw_input("Contest username? [%s] " % (user,))
    options.username = user if user else options.username
    options.database_root_password = get_password("database root")
    db_user = options.database_user
    db_user = raw_input("Contest database username? [%s] " % (db_user,))
    options.database_user = db_user if db_user else options.database_user
    options.database_password = get_password("contest database")
    db_name = options.database_name
    db_name = raw_input("Name of contest database? [%s] " % (db_name,))
    options.database_name = db_name if db_name else options.database_name
    root_dir = options.root_dir
    root_dir = raw_input("Contest root directory? [%s] " % (root_dir,))
    options.root_dir = root_dir if root_dir else options.root_dir
    repo_dir = options.local_repo
    repo_dir = raw_input("Directory of source repository? [%s] " % (repo_dir,))
    options.local_repo = repo_dir if repo_dir else options.local_repo
    webname = options.website_hostname
    webname = raw_input("Website hostname? [%s] " % (webname,))
    options.website_hostname = webname if webname else options.website_hostname
    default = options.website_as_default
    default = get_choice("Make contest site the default website?", default)
    options.website_as_default = default
Example #3
0
def interactive_options(options):
    print "Warning: This script is meant to be run as root and will make changes to the configuration of the machine it is run on."
    resp = raw_input("Are you sure you want to continue (yes/no)? [no] ")
    if resp != "yes":
        sys.exit(1)
    pkg_only = get_choice("Only install system packages?")
    options.packages_only = pkg_only
    if pkg_only:
        print "Only system packages will be installed, no further setup will be done."
        return
    user = options.username
    user = raw_input("Contest username? [%s] " % (user,))
    options.username = user if user else options.username
    options.database_root_password = get_password("database root")
    db_user = options.username
    db_user = raw_input("Contest database username? [%s] " % (db_user,))
    options.database_user = db_user if db_user else options.username
    options.database_password = get_password("contest database")
    db_name = options.database_name
    db_name = raw_input("Name of contest database? [%s] " % (db_name,))
    options.database_name = db_name if db_name else options.database_name
    root_dir = options.root_dir
    root_dir = raw_input("Contest root directory? [%s] " % (root_dir,))
    options.root_dir = root_dir if root_dir else options.root_dir
    repo_dir = options.local_repo
    repo_dir = raw_input("Directory of source repository? [%s] " % (repo_dir,))
    options.local_repo = repo_dir if repo_dir else options.local_repo
    upload_dir = options.upload_dir
    upload_dir = raw_input("Directory of uploaded submissions? [%s] " % (upload_dir,))
    options.upload_dir = upload_dir if upload_dir else options.upload_dir
    map_dir = options.map_dir
    map_dir = raw_input("Directory of game maps? [%s] " % (map_dir,))
    options.map_dir = map_dir if map_dir else options.map_dir
    replay_dir = options.replay_dir
    replay_dir = raw_input("Directory of game replays? [%s] " % (replay_dir,))
    options.replay_dir = replay_dir if replay_dir else options.replay_dir
    webname = options.website_hostname
    webname = raw_input("Website hostname? [%s] " % (webname,))
    options.website_hostname = webname if webname else options.website_hostname
    default = options.website_as_default
    default = get_choice("Make contest site the default website?", default)
    options.website_as_default = default
Example #4
0
def interactive_options(options):
    print "Warning: This script is meant to be run as root and will make changes to the configuration of the machine it is run on."
    resp = raw_input("Are you sure you want to continue (yes/no)? [no] ")
    if resp != "yes":
        sys.exit(1)
    sys_update = options.update_system
    options.update_system = get_choice(
            "Update and upgrade system before rest of setup?",
            options.update_system)
    options.create_jails = get_choice("Create bot jails?", options.create_jails)
    pkg_only = get_choice(
            "Only install packages and base jail, do no additional setup?",
            options.packages_only)
    options.packages_only = pkg_only
    if pkg_only:
        print "Only system packages will be installed, no further setup will be done."
        return
    user = options.username
    user = raw_input("Contest username? [%s] " % (user,))
    options.username = user if user else options.username
    root_dir = options.root_dir
    root_dir = raw_input("Contest root directory? [%s] " % (root_dir,))
    options.root_dir = root_dir if root_dir else options.root_dir
    repo_dir = options.local_repo
    repo_dir = raw_input("Directory of source repository? [%s] " % (repo_dir,))
    options.local_repo = repo_dir if repo_dir else options.local_repo
    base_url = options.api_url
    base_url = raw_input("API Base url? [%s] " % (base_url,))
    options.api_url = base_url if base_url else options.api_url
    api_key = options.api_key
    api_key = raw_input("Worker API key? [%s] " % (api_key,))
    options.api_key = api_key if api_key else options.api_key
    options.install_cronjob = get_choice("Install startup cronjob?",
            options.install_cronjob)
    options.run_worker = get_choice(
            "Immediately run worker start script at end of setup?",
            options.run_worker)