Exemple #1
0
 def test_set_verbosity(self):
     set_verbosity(True)
     from hokusai.lib.common import VERBOSE
     self.assertEqual(VERBOSE, True)
Exemple #2
0
def status(resources, pods, describe, top, filename, verbose):
  """Print Kubernetes resources in the staging context"""
  set_verbosity(verbose)
  hokusai.k8s_status(KUBE_CONTEXT, resources, pods, describe, top, filename=filename)
Exemple #3
0
def deploy(tag, migration, constraint, git_remote, timeout, update_config, filename, verbose):
  """Update the project's deployment(s) to reference
  the given image tag and update the tag staging
  to reference the same image"""
  set_verbosity(verbose)
  hokusai.update(KUBE_CONTEXT, tag, migration, constraint, git_remote, timeout, update_config=update_config, filename=filename)
Exemple #4
0
def setup(app_name, verbose, source_file):
    """Setup a new review-app - create a Yaml file based on APP_NAME and --source-file"""
    set_verbosity(verbose)
    hokusai.create_new_app_yaml(source_file, app_name)
Exemple #5
0
def start(build, detach, filename, verbose):
    """Start the development environment defined in ./hokusai/development.yml"""
    set_verbosity(verbose)
    hokusai.dev_start(build, detach, filename)
Exemple #6
0
def refresh(app_name, deployment, verbose):
    """Refresh the project's deployment(s) by recreating the currently running containers"""
    set_verbosity(verbose)
    hokusai.refresh(KUBE_CONTEXT, deployment, namespace=clean_string(app_name))
Exemple #7
0
def copy(app_name, verbose):
    """Copies the app's environment config map to the namespace {APP_NAME}"""
    set_verbosity(verbose)
    hokusai.k8s_copy_config(KUBE_CONTEXT, clean_string(app_name))
Exemple #8
0
def get(env_vars, verbose):
  """Print environment variables stored on the Kubernetes server"""
  set_verbosity(verbose)
  hokusai.get_env(KUBE_CONTEXT, env_vars)
Exemple #9
0
def set(env_vars, verbose):
  """Set environment variables - each of {ENV_VARS} must be in of form 'KEY=VALUE'"""
  set_verbosity(verbose)
  hokusai.set_env(KUBE_CONTEXT, env_vars)
Exemple #10
0
def refresh(deployment, verbose):
  """Refresh the project's deployment(s) by recreating the currently running containers"""
  set_verbosity(verbose)
  hokusai.refresh(KUBE_CONTEXT, deployment)
Exemple #11
0
def restart(deployment, verbose):
  """Alias for 'refresh'"""
  set_verbosity(verbose)
  hokusai.refresh(KUBE_CONTEXT, deployment)
Exemple #12
0
def create(filename, verbose):
    """Create the Kubernetes resources defined in ./hokusai/production.yml"""
    set_verbosity(verbose)
    hokusai.k8s_create(KUBE_CONTEXT, filename=filename)
Exemple #13
0
def status(filename, verbose):
    """Print the status of the development environment defined in ./hokusai/development.yml"""
    set_verbosity(verbose)
    hokusai.dev_status(filename)
Exemple #14
0
def stop(filename, verbose):
    """Stop the development environment defined in ./hokusai/development.yml"""
    set_verbosity(verbose)
    hokusai.dev_stop(filename)
Exemple #15
0
 def test_verbose_returns_input(self):
     with captured_output() as (out, err):
         set_verbosity(True)
         msg = verbose(TEST_MESSAGE)
         self.assertEqual(msg, TEST_MESSAGE)
Exemple #16
0
def unset(env_vars, verbose):
  """Unset environment variables - each of {ENV_VARS} must be of the form 'KEY'"""
  set_verbosity(verbose)
  hokusai.unset_env(KUBE_CONTEXT, env_vars)
Exemple #17
0
 def test_non_verbose_output(self):
     set_verbosity(False)
     with captured_output() as (out, err):
         verbose(TEST_MESSAGE)
         self.assertEqual(out.getvalue().strip(), '')
Exemple #18
0
def create(filename, environment, verbose):
  """Create the Kubernetes resources defined in ./hokusai/staging.yml"""
  set_verbosity(verbose)
  hokusai.k8s_create(KUBE_CONTEXT, filename=filename, environment=environment)
Exemple #19
0
def restart(app_name, deployment, verbose):
    """Alias for 'refresh'"""
    set_verbosity(verbose)
    hokusai.refresh(KUBE_CONTEXT, deployment, namespace=clean_string(app_name))
Exemple #20
0
def delete(filename, verbose):
  """Delete the Kubernetes resources defined in ./hokusai/staging.yml"""
  set_verbosity(verbose)
  hokusai.k8s_delete(KUBE_CONTEXT, filename=filename)
Exemple #21
0
def create(app_name, verbose):
    """Create the Kubernetes configmap object `{project_name}-environment` in the {APP_NAME} namespace"""
    set_verbosity(verbose)
    hokusai.create_env(KUBE_CONTEXT, namespace=clean_string(app_name))
Exemple #22
0
def update(check_branch, check_remote, skip_checks, filename, dry_run, verbose):
  """Update the Kubernetes resources defined in ./hokusai/staging.yml"""
  set_verbosity(verbose)
  hokusai.k8s_update(KUBE_CONTEXT, check_branch=check_branch,
                      check_remote=check_remote, skip_checks=skip_checks,
                      filename=filename, dry_run=dry_run)
Exemple #23
0
def get(app_name, env_vars, verbose):
    """Print environment variables stored on the Kubernetes server"""
    set_verbosity(verbose)
    hokusai.get_env(KUBE_CONTEXT, env_vars, namespace=clean_string(app_name))
Exemple #24
0
def clean(filename, verbose):
    """Stop and remove all containers in the development environment defined in ./hokusai/development.yml"""
    set_verbosity(verbose)
    hokusai.dev_clean(filename)