Skip to content

Commit 508cd39

Browse files
authored
Breeze should load local tmux configuration in 'breeze start-airflow' (#15454)
1 parent fdea622 commit 508cd39

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

BREEZE.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,26 @@ You should set up the autocomplete option automatically by running:
258258
259259
You get the auto-completion working when you re-enter the shell.
260260

261+
Customize your environment
262+
--------------------------
261263
When you enter the Breeze environment, automatically an environment file is sourced from
262264
``files/airflow-breeze-config/variables.env``. The ``files`` folder from your local sources is
263265
automatically mounted to the container under ``/files`` path and you can put there any files you want
264266
to make available for the Breeze container.
265267

268+
You can also add your local tmux configuration in ``files/airflow-breeze-config/.tmux.conf`` and
269+
these configurations will be available for your tmux environment.
270+
271+
there is a symlink between ``files/airflow-breeze-config/.tmux.conf`` and ``~/.tmux.conf`` in the container,
272+
so you can change it at any place, and run
273+
274+
.. code-block:: bash
275+
276+
tmux source ~/.tmux.conf
277+
278+
inside container, to enable modified tmux configurations.
279+
280+
266281
.. raw:: html
267282

268283
<div align="center">

scripts/in_container/configure_environment.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
export FILES_DIR="/files"
2020
export AIRFLOW_BREEZE_CONFIG_DIR="${FILES_DIR}/airflow-breeze-config"
2121
VARIABLES_ENV_FILE="variables.env"
22+
TMUX_CONF_FILE=".tmux.conf"
2223

2324
if [[ -d "${FILES_DIR}" ]]; then
2425
export AIRFLOW__CORE__DAGS_FOLDER="/files/dags"
@@ -48,3 +49,20 @@ else
4849
echo "In it to make breeze source the variables automatically for you"
4950
echo
5051
fi
52+
53+
54+
if [[ -d "${AIRFLOW_BREEZE_CONFIG_DIR}" && \
55+
-f "${AIRFLOW_BREEZE_CONFIG_DIR}/${TMUX_CONF_FILE}" ]]; then
56+
pushd "${AIRFLOW_BREEZE_CONFIG_DIR}" >/dev/null 2>&1 || exit 1
57+
echo
58+
echo "Using ${TMUX_CONF_FILE} from ${AIRFLOW_BREEZE_CONFIG_DIR}"
59+
echo
60+
# shellcheck disable=1090
61+
ln -sf "${AIRFLOW_BREEZE_CONFIG_DIR}/${TMUX_CONF_FILE}" ~
62+
popd >/dev/null 2>&1 || exit 1
63+
else
64+
echo
65+
echo "You can add ${AIRFLOW_BREEZE_CONFIG_DIR} directory and place ${TMUX_CONF_FILE}"
66+
echo "in it to make breeze use your local ${TMUX_CONF_FILE} for tmux"
67+
echo
68+
fi

0 commit comments

Comments
 (0)