From 97bf1ea1dabddc212c5ee8858213efe1f2251f6c Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 28 Aug 2020 20:52:08 -0300 Subject: Add ci-logs from static files --- ci-gen-index.sh | 57 ++++++++++++++++++++++++++++++++++++++++++++++ nixos-switch.sh | 1 + secrets/secret-envrc.sh | Bin 3937 -> 4014 bytes vps-configuration.env.nix | 8 +++++++ 4 files changed, 66 insertions(+) create mode 100755 ci-gen-index.sh diff --git a/ci-gen-index.sh b/ci-gen-index.sh new file mode 100755 index 0000000..2c9f777 --- /dev/null +++ b/ci-gen-index.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +set -Eeuo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +printf "Generating index.html of build logs... " +rm -f index.html + +cat <> index.html + + + + + + + + + +

+ Build logs +

+EOF + +for dir in */; do + d="${dir%/}" + cat <> index.html +

+ + $dir + +

+
    +EOF + for file in "$d"/*; do + cat <> index.html +
  • + +
    $file
    +
    +
  • +EOF + done + + cat <> index.html +
+EOF +done + +cat <> index.html + + +EOF + +echo "done." diff --git a/nixos-switch.sh b/nixos-switch.sh index af3606d..b74b8b5 100755 --- a/nixos-switch.sh +++ b/nixos-switch.sh @@ -12,6 +12,7 @@ ssh "${TLD}" rm -rf "${DATA_ROOT}/favicons/" rsync -avzP favicons/ "${TLD}:${DATA_ROOT}/favicons/" scp cgit-about.html "${TLD}:${GIT_ROOT}/about.html" +scp ci-gen-index.sh "${TLD}:${CI_LOGS_ROOT}/ci-gen-index.sh" scp bash-profile.sh "${TLD}:.bash_profile" echo "${USER_PASSWORD}" | ssh "$TLD" sudo -S systemctl restart pires-prod.service diff --git a/secrets/secret-envrc.sh b/secrets/secret-envrc.sh index 79307fd..1fd8385 100644 Binary files a/secrets/secret-envrc.sh and b/secrets/secret-envrc.sh differ diff --git a/vps-configuration.env.nix b/vps-configuration.env.nix index e18ed75..82b0ea7 100644 --- a/vps-configuration.env.nix +++ b/vps-configuration.env.nix @@ -8,6 +8,7 @@ let prosodyTLD = "$PROSODY_TLD"; bonecoTLD = "$BONECO_TLD"; pdfsTLD = "$PDFS_TLD"; + ciLogsTLD = "$CI_LOGS_TLD"; songbooksDocumentationTLD = "$SONGBOOKS_DOCUMENTATION_TLD"; piresDocumentationTLD = "$PIRES_DOCUMENTATION_TLD"; piresProdTLD = "$PIRES_PROD_TLD"; @@ -19,6 +20,7 @@ let userName = "$USER_NAME"; dataRoot = "$DATA_ROOT"; staticRoot = "$STATIC_ROOT"; + ciLogsRoot = "$CI_LOGS_ROOT"; faviconsRoot = "$FAVICONS_ROOT"; nextcloudDatabaseUser = "$NEXTCLOUD_DATABASE_USER"; nextcloudDatabasePassword = "$NEXTCLOUD_DATABASE_PASSWORD"; @@ -147,6 +149,11 @@ in { enableACME = true; root = staticSiteFromRepo "pdfs-da-d-maria"; }; + "${envsubstConfiguration.ciLogsTLD}" = { + forceSSL = true; + enableACME = true; + root = "${envsubstConfiguration.ciLogsRoot}"; + }; "${envsubstConfiguration.songbooksDocumentationTLD}" = { forceSSL = true; enableACME = true; @@ -316,6 +323,7 @@ in { staticRoot gitRoot faviconsRoot + ciLogsRoot dataRoot ]); serviceConfig = { Type = "oneshot"; }; -- cgit v1.2.3