You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2021/03/03 09:34:38 UTC
[airflow] 01/38: Log all breeze output to a file automatically
(#14470)
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v2-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 460e0683458fbac1686dd5bb3b4ee6b1d82e1d69
Author: Jarek Potiuk <po...@apache.org>
AuthorDate: Fri Feb 26 21:49:56 2021 +0100
Log all breeze output to a file automatically (#14470)
(cherry picked from commit 4a54292b69bb9a68a354c34246f019331270df3d)
---
BREEZE.rst | 2 ++
breeze | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/BREEZE.rst b/BREEZE.rst
index 131f94c..c79cdee 100644
--- a/BREEZE.rst
+++ b/BREEZE.rst
@@ -36,6 +36,8 @@ We called it *Airflow Breeze* as **It's a Breeze to contribute to Airflow**.
The advantages and disadvantages of using the Breeze environment vs. other ways of testing Airflow
are described in `CONTRIBUTING.rst <CONTRIBUTING.rst#integration-test-development-environment>`_.
+All the output from the last ./breeze command is automatically logged to the ``logs/breeze.out`` file.
+
Watch the video below about Airflow Breeze. It explains the motivation for Breeze
and screencasts all its uses.
diff --git a/breeze b/breeze
index c5d420b..124ed85 100755
--- a/breeze
+++ b/breeze
@@ -18,10 +18,20 @@
# under the License.
set -euo pipefail
+
AIRFLOW_SOURCES="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+if [[ ${BREEZE_REDIRECT=} == "" ]]; then
+ mkdir -p "${AIRFLOW_SOURCES}"/logs
+ export BREEZE_REDIRECT="true"
+ "${0}" "${@}" 2>&1 | tee "${AIRFLOW_SOURCES}"/logs/breeze.out
+ exit
+fi
+
export AIRFLOW_SOURCES
readonly AIRFLOW_SOURCES
+
# Bash arrays need to be defined outside of functions unfortunately :(
# Because on Mac OS Bash 3.4 defining arrays inside functions does not work
# Array with extra options for Docker compose