aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-08-28 20:52:08 -0300
committerEuAndreh <eu@euandre.org>2020-08-28 22:01:44 -0300
commit97bf1ea1dabddc212c5ee8858213efe1f2251f6c (patch)
treeba0b36bb9b95d7beef5de424a138a94a6e664267
parentAdd $lang prefix to root songbooks documentation path redirect (diff)
downloadserver-97bf1ea1dabddc212c5ee8858213efe1f2251f6c.tar.gz
server-97bf1ea1dabddc212c5ee8858213efe1f2251f6c.tar.xz
Add ci-logs from static files
-rwxr-xr-xci-gen-index.sh57
-rwxr-xr-xnixos-switch.sh1
-rw-r--r--secrets/secret-envrc.shbin3937 -> 4014 bytes
-rw-r--r--vps-configuration.env.nix8
4 files changed, 66 insertions, 0 deletions
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 <<EOF >> index.html
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+
+ <style>
+ pre {
+ display: inline;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>
+ Build logs
+ </h1>
+EOF
+
+for dir in */; do
+ d="${dir%/}"
+ cat <<EOF >> index.html
+ <h2 id="$d">
+ <a href="#$d">
+ $dir
+ </a>
+ </h2>
+ <ul>
+EOF
+ for file in "$d"/*; do
+ cat <<EOF >> index.html
+ <li>
+ <a href="$file">
+ <pre>$file</pre>
+ </a>
+ </li>
+EOF
+ done
+
+ cat <<EOF >> index.html
+ </ul>
+EOF
+done
+
+cat <<EOF >> index.html
+ </body>
+</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
--- a/secrets/secret-envrc.sh
+++ b/secrets/secret-envrc.sh
Binary files 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"; };