From 2bbe3fd19e1f057a7129365cdb4ef5e9336e977e Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 27 Mar 2023 14:41:36 -0300 Subject: src/infrastructure/config/conf.env: Use file to parameterize reconfigure(8) and report(8) scripts --- src/infrastructure/scripts/reconfigure.sh | 7 +++++-- src/infrastructure/scripts/report.sh | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'src/infrastructure/scripts') diff --git a/src/infrastructure/scripts/reconfigure.sh b/src/infrastructure/scripts/reconfigure.sh index 945f115..ed3da6f 100755 --- a/src/infrastructure/scripts/reconfigure.sh +++ b/src/infrastructure/scripts/reconfigure.sh @@ -85,8 +85,10 @@ while getopts 'nUh' flag; do done shift $((OPTIND - 1)) +# shellcheck source=/dev/null +. /etc/conf.env SHA="${1:-main}" -REPO='/srv/git/servers.git' +REPO="/srv/git/$REPO_NAME" NOW="$(date '+%Y-%m-%dT%H:%M:%S%:z')" NOW_DIR=/opt/deploy/"$NOW" NPROC=$(($(nproc) * 2 + 1)) @@ -135,6 +137,7 @@ else --chown=deployer:deployer \ -a \ --exclude='dev/ci/*' \ - /run/current-system/profile/share/doc/servers/ /srv/www/s/servers/ + /run/current-system/profile/share/doc/"$NAME"/ "$HTML_OUTDIR" + deploy fi diff --git a/src/infrastructure/scripts/report.sh b/src/infrastructure/scripts/report.sh index 54fbcd8..5c89b91 100755 --- a/src/infrastructure/scripts/report.sh +++ b/src/infrastructure/scripts/report.sh @@ -119,6 +119,15 @@ if [ -z "${OUTDIR:-}" ]; then exit 2 fi +if [ -r src/infrastructure/config/conf.env ]; then + CONF=src/infrastructure/config/conf.env +else + CONF=/etc/conf.env +fi + +# shellcheck source=/dev/null +. "$CONF" + esc() { sed \ @@ -147,9 +156,9 @@ done - + - servers - CI logs + $NAME - CI logs