Esempio n. 1
0
def change_config(python, backend, cheatsheet, asciiart):
    """
    Toggles on/off cheatsheet, asciiart
    """
    from airflow_breeze.cache import delete_cache, touch_cache_file, write_to_cache_file

    if asciiart:
        console.print('[blue] ASCIIART enabled')
        delete_cache('suppress_asciiart')
    elif asciiart is not None:
        touch_cache_file('suppress_asciiart')
    else:
        pass
    if cheatsheet:
        console.print('[blue] Cheatsheet enabled')
        delete_cache('suppress_cheatsheet')
    elif cheatsheet is not None:
        touch_cache_file('suppress_cheatsheet')
    else:
        pass
    if python is not None:
        write_to_cache_file('PYTHON_MAJOR_MINOR_VERSION', python)
        console.print(f'[blue]Python cached_value {python}')
    if backend is not None:
        write_to_cache_file('BACKEND', backend)
        console.print(f'[blue]Backend cached_value {backend}')
Esempio n. 2
0
def build_image(verbose, **kwargs):
    parameters_passed = filter_out_none(**kwargs)
    ci_image_params = get_image_build_params(parameters_passed)
    ci_image_cache_dir = Path(BUILD_CACHE_DIR, ci_image_params.airflow_branch)
    ci_image_cache_dir.mkdir(parents=True, exist_ok=True)
    touch_cache_file(
        f"built_{ci_image_params.python_version}",
        root_dir=ci_image_cache_dir,
    )
    cmd = construct_docker_command(ci_image_params)
    output = run_command(cmd, verbose=verbose, cwd=AIRFLOW_SOURCE, text=True)
    console.print(f"[blue]{output}")