diff --git a/BREEZE.rst b/BREEZE.rst index 2b607f559a030..e45ffab40c078 100644 --- a/BREEZE.rst +++ b/BREEZE.rst @@ -258,11 +258,26 @@ You should set up the autocomplete option automatically by running: You get the auto-completion working when you re-enter the shell. +Customize your environment +-------------------------- When you enter the Breeze environment, automatically an environment file is sourced from ``files/airflow-breeze-config/variables.env``. The ``files`` folder from your local sources is automatically mounted to the container under ``/files`` path and you can put there any files you want to make available for the Breeze container. +You can also add your local tmux configuration in ``files/airflow-breeze-config/.tmux.conf`` and +these configurations will be available for your tmux environment. + +there is a symlink between ``files/airflow-breeze-config/.tmux.conf`` and ``~/.tmux.conf`` in the container, +so you can change it at any place, and run + +.. code-block:: bash + + tmux source ~/.tmux.conf + +inside container, to enable modified tmux configurations. + + .. raw:: html
diff --git a/scripts/in_container/configure_environment.sh b/scripts/in_container/configure_environment.sh index 01c3487ef7cd4..07648bf4b5318 100644 --- a/scripts/in_container/configure_environment.sh +++ b/scripts/in_container/configure_environment.sh @@ -19,6 +19,7 @@ export FILES_DIR="/files" export AIRFLOW_BREEZE_CONFIG_DIR="${FILES_DIR}/airflow-breeze-config" VARIABLES_ENV_FILE="variables.env" +TMUX_CONF_FILE=".tmux.conf" if [[ -d "${FILES_DIR}" ]]; then export AIRFLOW__CORE__DAGS_FOLDER="/files/dags" @@ -48,3 +49,20 @@ else echo "In it to make breeze source the variables automatically for you" echo fi + + +if [[ -d "${AIRFLOW_BREEZE_CONFIG_DIR}" && \ + -f "${AIRFLOW_BREEZE_CONFIG_DIR}/${TMUX_CONF_FILE}" ]]; then + pushd "${AIRFLOW_BREEZE_CONFIG_DIR}" >/dev/null 2>&1 || exit 1 + echo + echo "Using ${TMUX_CONF_FILE} from ${AIRFLOW_BREEZE_CONFIG_DIR}" + echo + # shellcheck disable=1090 + ln -sf "${AIRFLOW_BREEZE_CONFIG_DIR}/${TMUX_CONF_FILE}" ~ + popd >/dev/null 2>&1 || exit 1 +else + echo + echo "You can add ${AIRFLOW_BREEZE_CONFIG_DIR} directory and place ${TMUX_CONF_FILE}" + echo "in it to make breeze use your local ${TMUX_CONF_FILE} for tmux" + echo +fi