diff options
author | EuAndreh <eu@euandre.org> | 2021-06-24 11:18:40 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-06-24 11:18:40 -0300 |
commit | 2539cf045c79ae1ebddccba7f887040d10e6ec1f (patch) | |
tree | 72f8f153f0880a98c4aa335e108be0c995b5b103 | |
parent | dependencies.dot: Songbooks could make money (diff) | |
download | package-repository-2539cf045c79ae1ebddccba7f887040d10e6ec1f.tar.gz package-repository-2539cf045c79ae1ebddccba7f887040d10e6ec1f.tar.xz |
aux/: Update
-rwxr-xr-x | aux/ci/ci-build.sh | 6 | ||||
-rwxr-xr-x | aux/ci/git-post-receive.sh | 6 | ||||
-rwxr-xr-x | aux/ci/git-pre-push.sh | 6 | ||||
-rwxr-xr-x | aux/ci/report.sh | 11 | ||||
-rwxr-xr-x | aux/guix/with-container.sh | 2 | ||||
-rwxr-xr-x | aux/workflow/TODOs.sh | 7 | ||||
-rwxr-xr-x | aux/workflow/assert-changelog.sh | 3 | ||||
-rwxr-xr-x | aux/workflow/assert-readme.sh | 7 | ||||
-rwxr-xr-x | aux/workflow/commonmark.sh | 7 | ||||
-rwxr-xr-x | aux/workflow/public.sh | 13 |
10 files changed, 33 insertions, 35 deletions
diff --git a/aux/ci/ci-build.sh b/aux/ci/ci-build.sh index 60af813..7fa3382 100755 --- a/aux/ci/ci-build.sh +++ b/aux/ci/ci-build.sh @@ -1,7 +1,7 @@ #!/bin/sh set -eux -PACKAGE="$1" +PROJECT="$1" LOGS_DIR="$2" read -r _ SHA _ # oldrev newrev refname FILENAME="$(date -Is)-$SHA.log" @@ -26,8 +26,8 @@ EOF git notes append -m "$NOTE" cd - - sh aux/ci/report.sh "$PACKAGE" - rsync -av public/ "/srv/http/$PACKAGE/" --delete + 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/git-post-receive.sh b/aux/ci/git-post-receive.sh index ee8075f..167ac4a 100755 --- a/aux/ci/git-post-receive.sh +++ b/aux/ci/git-post-receive.sh @@ -9,6 +9,6 @@ for n in $(seq 0 $((GIT_PUSH_OPTION_COUNT - 1))); do fi done -PACKAGE="$(basename "$PWD" | cut -d. -f1)" # remove .git suffix -LOGS_DIR="/opt/ci/$PACKAGE/logs" -"/opt/ci/$PACKAGE/ci-build.sh" "$PACKAGE" "$LOGS_DIR" +PROJECT="$(basename "$PWD" | cut -d. -f1)" # remove .git suffix +LOGS_DIR="/opt/ci/$PROJECT/logs" +"/opt/ci/$PROJECT/ci-build.sh" "$PROJECT" "$LOGS_DIR" diff --git a/aux/ci/git-pre-push.sh b/aux/ci/git-pre-push.sh index e73b9b8..cccd6e5 100755 --- a/aux/ci/git-pre-push.sh +++ b/aux/ci/git-pre-push.sh @@ -3,9 +3,9 @@ set -eux TLD="$(cat aux/tld.txt)" -PACKAGE="$(basename "$PWD")" -LOGS_DIR="/opt/ci/$PACKAGE/logs" -REMOTE_GIT_DIR="/srv/git/$PACKAGE.git" +PROJECT="$(basename "$PWD")" +LOGS_DIR="/opt/ci/$PROJECT/logs" +REMOTE_GIT_DIR="/srv/git/$PROJECT.git" DESCRIPTION="$(mktemp)" if [ -f description ] 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/guix/with-container.sh b/aux/guix/with-container.sh index b521c82..408fb39 100755 --- a/aux/guix/with-container.sh +++ b/aux/guix/with-container.sh @@ -1,5 +1,5 @@ #!/bin/sh -set -eux +set -eu if [ -z "${1:-}" ]; then guix time-machine --fallback -C aux/guix/pinned-channels.scm -- \ diff --git a/aux/workflow/TODOs.sh b/aux/workflow/TODOs.sh index 9f9f657..f93ece8 100755 --- a/aux/workflow/TODOs.sh +++ b/aux/workflow/TODOs.sh @@ -1,14 +1,13 @@ #!/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<span class="header-anchor" id="\3">#\3<\/span>\n/' +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/' TODOS_CLEANUP_REGEX1='s/(<a><a)/<a/' TODOS_CLEANUP_REGEX2='s/<\/a><\/a>/<\/a>/' @@ -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/assert-changelog.sh b/aux/workflow/assert-changelog.sh index 61cd916..e2cd926 100755 --- a/aux/workflow/assert-changelog.sh +++ b/aux/workflow/assert-changelog.sh @@ -33,8 +33,7 @@ for VVERSION in $(git tag); do done # "$@" represents a list of tags to be also included in the verification. -# shellcheck disable=2068 -for VVERSION in $@; do +for VVERSION in "$@"; do DATE="$(date '+%Y-%m-%d')" assert "$DATE" "$VVERSION" done diff --git a/aux/workflow/assert-readme.sh b/aux/workflow/assert-readme.sh index 2e5d978..2a6c3fd 100755 --- a/aux/workflow/assert-readme.sh +++ b/aux/workflow/assert-readme.sh @@ -1,8 +1,6 @@ #!/bin/sh set -eu -mkdir -p public - PROJECT="$1" MAILING_LIST="$2" shift @@ -43,7 +41,7 @@ RELEASES_LIST="$(mktemp)" add_release() { DATE="$1" VVERSION="$2" - echo "- version [$VVERSION](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.gz) ([sig](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.gz.asc)), released in $DATE" >> "$RELEASES_LIST" + echo "- [$VVERSION](https://git.euandreh.xyz/$PROJECT/commit/?id=$VVERSION) [$PROJECT-$VVERSION.tar.gz](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.gz) ([sig](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.gz.asc)), released in $DATE" >> "$RELEASES_LIST" } for VVERSION in $(git tag); do @@ -52,8 +50,7 @@ for VVERSION in $(git tag); do done # "$@" represents a list of tags to be also included in the verification. -# shellcheck disable=2068 -for VVERSION in $@; do +for VVERSION in "$@"; do if ! git tag | grep -qF "$VVERSION"; then DATE="$(date '+%Y-%m-%d')" add_release "$DATE" "$VVERSION" 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 8ecb855..7433595 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.* public/ +cp aux/workflow/favicon.svg aux/workflow/favicon.png "$OUTDIR" |