From 629ee07c79e544e67db60f8086a8109b96d90b67 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 3 Jan 2020 13:17:35 +0300 Subject: [PATCH] feat(install): Add automatic logs to install script (#312) This change makes the install script create a new install log file, `sentry_install_log-.txt`, for each run and records all the output there for future reference. --- .gitignore | 1 + README.md | 4 ++-- install.sh | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 802aab9..77b24eb 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ var/ # Installer logs pip-log.txt pip-delete-this-directory.txt +sentry_install_log*.txt # Unit test / coverage reports htmlcov/ diff --git a/README.md b/README.md index 2a0267c..f74fbaa 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ The recommended way to customize your configuration is using the files below, in We currently support a very minimal set of environment variables to promote other means of configuration. -If you have any issues or questions, our [Community Forum](https://forum.sentry.io/c/on-premise) is at your service! +If you have any issues or questions, our [Community Forum](https://forum.sentry.io/c/on-premise) is at your service! Everytime you run the install script, it will generate a log file, `sentry_install_log-.txt` with the output. Sharing these logs would help people diagnose any issues you might be having. ## Event Retention @@ -41,7 +41,7 @@ and [Nginx](http://nginx.org/). You'll likely want to add this service to your ` ## Updating Sentry -The included `install.sh` script is meant to be idempotent and to bring you to the latest version. What this means is you can and should run `install.sh` to upgrade to the latest version available. +The included `install.sh` script is meant to be idempotent and to bring you to the latest version. What this means is you can and should run `install.sh` to upgrade to the latest version available. Remember that the output of the script will be stored in a log file, `sentry_install_log-.txt`, which you may share for diagnosis if anything goes wrong. ## Resources diff --git a/install.sh b/install.sh index 742d131..9d6e32f 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash set -e +# Thanks to https://unix.stackexchange.com/a/145654/108960 +log_file="sentry_install_log-`date +'%Y-%m-%d_%H-%M-%S'`.txt" +exec &> >(tee -a "$log_file") + MIN_DOCKER_VERSION='17.05.0' MIN_COMPOSE_VERSION='1.19.0' MIN_RAM=2400 # MB