示例#1
0
def rancher_agents_provision(ctx):
    """
    Provision Rancher Agent nodes.
    """
    try:
        RancherAgents().provision()
    except RancherAgentsError as e:
        err_and_exit("Failed to provision Rancher Agent nodes! : {}".format(
            e.message))
    log_success("Rancher Agents provisioning : [OK]")
示例#2
0
def rancher_server_configure(ctx):
    """
    Configure Rancher Server node.
    """
    try:
        RancherServer().configure()
    except RancherServerError as e:
        err_and_exit("Failed to configure Rancher Server node! : {}".format(
            e.message))
    log_success("Rancher Server configuration: [OK]")
示例#3
0
def rancher_server_deprovision(ctx):
    """
    Deprovision Rancher Server node.
    """
    try:
        RancherServer().deprovision()
    except RancherServerError as e:
        err_and_exit("Failed to deprovision Rancher Server node! : {}".format(
            e.message))
    log_success("Rancher Server deprovisioning : [OK]")
示例#4
0
def rancher_server_provision(ctx):
    """
    Provision Rancher Server node.
    """
    try:
        result = RancherServer().provision()
    except RancherServerError as e:
        err_and_exit("Failed to provision Rancher Server node! : {}".format(
            e.message))
    log_success("Rancher Server provisioning : [OK]")
    return result
示例#5
0
def lint(ctx):
    """
    Recursively lint check Python files in this project using flake8.
    """

    log_info("Lint checking Python files...")
    lint_check(os.path.dirname(__file__), 'py', excludes=['validation-tests'])
    log_success()

    log_info("Lint checking of Puppet files...")
    lint_check(os.path.dirname(__file__), 'pp', excludes=['validation-tests'])
    log_success()
示例#6
0
def bootstrap(ctx):
    """
    Build the utility container which will be used to execute the test pipeline.
    """

    log_info('Bootstrapping the workspace and the utility container...')
    try:
        run('docker build -t rancherlabs/ci-validation-tests -f Dockerfile .',
            echo=True)
        run('git clone https://github.com/rancher/validation-tests', echo=True)
    except Failure as e:
        err_and_exit("Failed to bootstrap the environment!: {} :: {}".format(
            e.result.return_code, e.result.stderr))

    log_success()
示例#7
0
def syntax(ctx):
    """
    Recursively syntax check various files.
    """

    log_info("Syntax checking of YAML files...")
    syntax_check(os.path.dirname(__file__), 'yaml')
    log_success()

    log_info("Syntax checking of Python files...")
    syntax_check(os.path.dirname(__file__), 'py')
    log_success()

    log_info("Syntax checking of Puppet files...")
    syntax_check(os.path.dirname(__file__), 'pp')
    log_success()

    log_info("Syntax checking of Ruby files...")
    syntax_check(os.path.dirname(__file__), 'rb')
    log_success()

    log_info("Syntax checking of BASH scripts..")
    syntax_check(os.path.dirname(__file__), 'sh')
    log_success()