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()
def reset(ctx): """ Reset the work directory for a new test run. """ log_info('Resetting the work directory...') try: run('rm -rf validation-tests', echo=True) except Failure as e: err_and_exit("Failed during reset of workspace!: {} :: {}".format( e.result.return_code, e.result.stderr))
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()