aboutsummaryrefslogtreecommitdiff
path: root/aux
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-06-23 08:07:14 -0300
committerEuAndreh <eu@euandre.org>2021-06-23 08:07:14 -0300
commit57335b3e7c4c9e91c5747778180d611e5f15d144 (patch)
tree4b3892bb4d46a4f3bdde2a31eb1980f795db9378 /aux
parentaux/workflow/assert-readme.sh: No need to create the public/ directory (diff)
downloadgit-permalink-57335b3e7c4c9e91c5747778180d611e5f15d144.tar.gz
git-permalink-57335b3e7c4c9e91c5747778180d611e5f15d144.tar.xz
aux/: Explicitly pass "public/" as a parameter to scripts
Diffstat (limited to 'aux')
-rwxr-xr-xaux/ci/ci-build.sh2
-rwxr-xr-xaux/ci/report.sh11
-rwxr-xr-xaux/workflow/TODOs.sh5
-rwxr-xr-xaux/workflow/commonmark.sh7
-rwxr-xr-xaux/workflow/public.sh13
5 files changed, 20 insertions, 18 deletions
diff --git a/aux/ci/ci-build.sh b/aux/ci/ci-build.sh
index 9f89205..7fa3382 100755
--- a/aux/ci/ci-build.sh
+++ b/aux/ci/ci-build.sh
@@ -26,7 +26,7 @@ EOF
git notes append -m "$NOTE"
cd -
- sh aux/ci/report.sh "$PROJECT"
+ sh aux/ci/report.sh "$PROJECT" public
rsync -av public/ "/srv/http/$PROJECT/" --delete
printf "\n>>>\n>>> CI logs added as Git note.\n>>>\n>>> Run status was %s" "$STATUS"
diff --git a/aux/ci/report.sh b/aux/ci/report.sh
index e71e1ac..c873f54 100755
--- a/aux/ci/report.sh
+++ b/aux/ci/report.sh
@@ -2,12 +2,13 @@
set -eu
PROJECT="$1"
+OUTDIR="$2"
TLD="$(cat aux/tld.txt)"
PASS='✅'
FAIL='❌'
-mkdir -p public/ci-logs public/ci-data
+mkdir -p "$OUTDIR/ci-logs" "$OUTDIR/ci-data"
OUT="$(mktemp)"
chmod 644 "$OUT"
@@ -20,8 +21,8 @@ wait
for c in $(git notes list | cut -d\ -f2); do
DATA="$(git notes --ref=refs/notes/ci-data show "$c")"
FILENAME="$(echo "$DATA" | cut -d\ -f2)"
- echo "$DATA" > "public/ci-data/$FILENAME"
- git notes --ref=refs/notes/ci-logs show "$c" > "public/ci-logs/$FILENAME"
+ echo "$DATA" > "$OUTDIR/ci-data/$FILENAME"
+ git notes --ref=refs/notes/ci-logs show "$c" > "$OUTDIR/ci-logs/$FILENAME"
done
cat <<EOF >> "$OUT"
@@ -46,7 +47,7 @@ cat <<EOF >> "$OUT"
<ul>
EOF
-for f in $(find public/ci-data/ -type f | LANG=C.UTF-8 sort -r); do
+for f in $(find "$OUTDIR/ci-data/" -type f | LANG=C.UTF-8 sort -r); do
DATA="$(cat "$f")"
STATUS="$(echo "$DATA" | cut -d\ -f1)"
FILENAME="$(echo "$DATA" | cut -d\ -f2)"
@@ -72,4 +73,4 @@ cat <<EOF >> "$OUT"
</html>
EOF
-mv "$OUT" public/ci.html
+mv "$OUT" "$OUTDIR/ci.html"
diff --git a/aux/workflow/TODOs.sh b/aux/workflow/TODOs.sh
index 160e76f..f93ece8 100755
--- a/aux/workflow/TODOs.sh
+++ b/aux/workflow/TODOs.sh
@@ -1,11 +1,10 @@
#!/bin/sh
set -eu
-mkdir -p public
-
PROJECT_UC="$1"
PROJECT="$2"
MAILING_LIST="$3"
+OUTDIR="$4"
TLD="$(cat aux/tld.txt)"
TODOS_ADD_REGEX='s/^## (TODO|DOING|WAITING|MEETING|INACTIVE|NEXT|CANCELLED|DONE) (.*) \{#(.*?)\}$/## <a href="#\3"><span class="\1">\1<\/span> \2<\/a>\n<pre class="header-anchor" id="\3">#\3<\/pre>\n/'
@@ -37,4 +36,4 @@ sed -e "s:@PROJECT_UC@:$PROJECT_UC:g" \
| \
perl -pe "$TODOS_CLEANUP_REGEX1" | \
perl -pe "$TODOS_CLEANUP_REGEX2" \
- > public/TODOs.html
+ > "$OUTDIR/TODOs.html"
diff --git a/aux/workflow/commonmark.sh b/aux/workflow/commonmark.sh
index 6016f51..7267145 100755
--- a/aux/workflow/commonmark.sh
+++ b/aux/workflow/commonmark.sh
@@ -1,11 +1,10 @@
#!/bin/sh
set -eu
-mkdir -p public
-
PROJECT_UC="$1"
F="$2"
-OUT="${3:-${F%.*}.html}"
+OUTDIR="$3"
+OUT="${4:-${F%.*}.html}"
pandoc \
--toc \
@@ -17,4 +16,4 @@ pandoc \
-r commonmark \
-w html \
-H aux/workflow/favicon.html \
- < "$F" > "public/$OUT"
+ < "$F" > "$OUTDIR/$OUT"
diff --git a/aux/workflow/public.sh b/aux/workflow/public.sh
index df87049..5222878 100755
--- a/aux/workflow/public.sh
+++ b/aux/workflow/public.sh
@@ -4,14 +4,17 @@ set -eu
PROJECT_UC="$1"
PROJECT="$2"
MAILING_LIST="$3"
+OUTDIR="$4"
-sh aux/workflow/TODOs.sh "$PROJECT_UC" "$PROJECT" "$MAILING_LIST"
-sh aux/workflow/commonmark.sh "$PROJECT" README.md index.html ||:
+mkdir -p "$OUTDIR"
+
+sh aux/workflow/TODOs.sh "$PROJECT_UC" "$PROJECT" "$MAILING_LIST" "$OUTDIR"
+sh aux/workflow/commonmark.sh "$PROJECT" README.md "$OUTDIR" index.html ||:
if [ -f CHANGELOG.md ]; then
- sh aux/workflow/commonmark.sh "$PROJECT" CHANGELOG.md
+ sh aux/workflow/commonmark.sh "$PROJECT" CHANGELOG.md "$OUTDIR"
fi
-sh aux/ci/report.sh "$PROJECT"
+sh aux/ci/report.sh "$PROJECT" "$OUTDIR"
-cp aux/workflow/favicon.{svg,png} public/
+cp aux/workflow/favicon.{svg,png} "$OUTDIR"