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]")
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]")
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]")
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
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()
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()
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()