Skip to content

Commit

Permalink
Breeze should load local tmux configuration in 'breeze start-airflow' (
Browse files Browse the repository at this point in the history
…apache#15454)

(cherry picked from commit 508cd39)
  • Loading branch information
pateash authored and potiuk committed May 6, 2021
1 parent fd3eddd commit 6fbce04
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
15 changes: 15 additions & 0 deletions BREEZE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

<div align="center">
Expand Down
18 changes: 18 additions & 0 deletions scripts/in_container/configure_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

0 comments on commit 6fbce04

Please sign in to comment.