From 7b915ee41dfbfeacaf2c1623172cfcae9389e930 Mon Sep 17 00:00:00 2001 From: Alban Bronisz Date: Thu, 2 Dec 2021 21:01:26 +0100 Subject: [PATCH] Update sh workflow --- README.md | 2 +- generate.sh | 1 - generate_html.sh | 14 ++++++++++++++ save_docker_stats.sh | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) delete mode 100755 generate.sh create mode 100755 generate_html.sh diff --git a/README.md b/README.md index 81bc674..0af6ff4 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Display stats This step permits to generate an html interactive render from the sqlite stats file. It is simple, just run: ```bash -venv/bin/python generate_html.py +./generate_html.sh ``` The report is now accessible in `stats.html`. diff --git a/generate.sh b/generate.sh deleted file mode 100755 index 96b8211..0000000 --- a/generate.sh +++ /dev/null @@ -1 +0,0 @@ -/home/caracals/outils/docker-stats-histo/venv/bin/python /home/caracals/outils/docker-stats-histo/generate_html.py /home/caracals/outils/docker-stats-histo/stats.sqlite /home/caracals/services/org-caracals-files/files/stats.html diff --git a/generate_html.sh b/generate_html.sh new file mode 100755 index 0000000..9579aa4 --- /dev/null +++ b/generate_html.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -eu + +# Move in repo folder +SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +pushd "${SCRIPT_PATH}" > /dev/null + + +venv/bin/python generate_html.py stats.sqlite /home/caracals/services/org-caracals-files/files/stats.html + + +# Back to original path +popd > /dev/null diff --git a/save_docker_stats.sh b/save_docker_stats.sh index dd1f09f..04ce49b 100755 --- a/save_docker_stats.sh +++ b/save_docker_stats.sh @@ -4,7 +4,7 @@ set -eu # Move in repo folder SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" -pushd ${SCRIPT_PATH} > /dev/null +pushd "${SCRIPT_PATH}" > /dev/null venv/bin/python save_docker_stats.py