diff options
-rwxr-xr-x | aux/assert-shellcheck.sh | 4 | ||||
-rwxr-xr-x | aux/ci/ci-build.sh | 5 | ||||
-rwxr-xr-x | aux/guix/with-container.sh | 3 | ||||
-rwxr-xr-x | aux/workflow/assert-readme.sh | 2 | ||||
-rwxr-xr-x | aux/workflow/dist.sh | 2 | ||||
-rwxr-xr-x | aux/workflow/sign-tarballs.sh | 6 | ||||
-rwxr-xr-x | tests/lib.sh | 15 |
7 files changed, 23 insertions, 14 deletions
diff --git a/aux/assert-shellcheck.sh b/aux/assert-shellcheck.sh index 29d66a5..40fd364 100755 --- a/aux/assert-shellcheck.sh +++ b/aux/assert-shellcheck.sh @@ -1,6 +1,6 @@ #!/bin/sh set -eu -git ls-files | - xargs awk 'FNR==1 && /^#!\/bin\/sh$/ { print FILENAME }' | +find . -name '*.sh' -print0 | + xargs -0 awk 'FNR==1 && /^#!\/bin\/sh$/ { print FILENAME }' | xargs shellcheck diff --git a/aux/ci/ci-build.sh b/aux/ci/ci-build.sh index 396fbff..007e7c4 100755 --- a/aux/ci/ci-build.sh +++ b/aux/ci/ci-build.sh @@ -38,6 +38,11 @@ EOF sh aux/ci/report.sh -n "$PROJECT" -o public rsync -av public/ "/srv/http/$PROJECT/" --delete + if [ -f aux/guix/with-container.sh ]; then + cp "$(sh aux/guix/with-container.sh -C)" \ + "/srv/http/$PROJECT/docker.tar.gz" + fi + printf "\n>>>\n>>> CI logs added as Git note." printf "\n>>>\n>>> Run status was %s\n\n" "$STATUS" } diff --git a/aux/guix/with-container.sh b/aux/guix/with-container.sh index 71e13e0..641b455 100755 --- a/aux/guix/with-container.sh +++ b/aux/guix/with-container.sh @@ -7,6 +7,9 @@ if [ -z "${1:-}" ]; then elif [ "$1" = '-p' ]; then guix time-machine --fallback -C aux/guix/pinned-channels.scm -- \ environment --fallback -m aux/guix/manifest.scm --pure -C +elif [ "$1" = '-C' ]; then + guix time-machine --fallback -C aux/guix/pinned-channels.scm -- \ + pack -f docker -S/bin=bin -m aux/guix/manifest.scm else guix time-machine --fallback -C aux/guix/pinned-channels.scm -- \ environment --fallback -m aux/guix/manifest.scm --pure -C \ diff --git a/aux/workflow/assert-readme.sh b/aux/workflow/assert-readme.sh index 6635832..dbe657e 100755 --- a/aux/workflow/assert-readme.sh +++ b/aux/workflow/assert-readme.sh @@ -64,7 +64,7 @@ RELEASES_LIST="$(mkstemp)" add_release() { DATE="$1" VVERSION="$2" - echo "- [$VVERSION](https://git.euandreh.xyz/$PROJECT/commit/?id=$VVERSION) [$PROJECT-$VVERSION.tar.xz](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.xz) ([sig](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.xz.asc)) - $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)) - $DATE" >> "$RELEASES_LIST" } for VVERSION in $(git tag); do diff --git a/aux/workflow/dist.sh b/aux/workflow/dist.sh index 15593f4..69c0173 100755 --- a/aux/workflow/dist.sh +++ b/aux/workflow/dist.sh @@ -73,7 +73,7 @@ sh aux/workflow/sign-tarballs.sh -n "$PROJECT" cat <<EOF >&2 Now push the tag and the signature before pushing the commit: -git push origin refs/notes/signatures/tar.xz -o skip-ci --no-verify +git push origin refs/notes/signatures/tar.gz -o skip-ci --no-verify git push --tags -o skip-ci --no-verify git push diff --git a/aux/workflow/sign-tarballs.sh b/aux/workflow/sign-tarballs.sh index 295619c..3ab2bb8 100755 --- a/aux/workflow/sign-tarballs.sh +++ b/aux/workflow/sign-tarballs.sh @@ -23,15 +23,15 @@ assert_arg() { assert_arg "${PROJECT:-}" '-n PROJECT' -SIGNATURES="$(git notes --ref=refs/notes/signatures/tar.xz list | cut -d\ -f2)" +SIGNATURES="$(git notes --ref=refs/notes/signatures/tar.gz list | cut -d\ -f2)" for tag in $(git tag); do COMMIT="$(git rev-list -n1 "$tag")" if echo "$SIGNATURES" | grep -qF "$COMMIT"; then continue fi echo "Adding missing signature to $tag" >&2 - git notes --ref=refs/notes/signatures/tar.xz add -C "$( - git archive --format tar.xz --prefix "$PROJECT-$tag/" "$tag" | + git notes --ref=refs/notes/signatures/tar.gz add -C "$( + git archive --format tar.gz --prefix "$PROJECT-$tag/" "$tag" | gpg --output - --armor --detach-sign | git hash-object -w --stdin )" "$tag" diff --git a/tests/lib.sh b/tests/lib.sh index 06a5b54..527e645 100755 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -16,7 +16,8 @@ ERROR() { } print_debug_info() { - printf 'LINENO: %s\nOUT: %s\nERR: %s\n' \ + # shellcheck disable=2016 + printf 'LINENO: %s\n$OUT: %s\n$ERR: %s\n' \ "$N" "$OUT" "$ERR" >&2 } @@ -59,8 +60,8 @@ assert_empty_stderr() { assert_stream() { if [ "$(cat "$2")" != "$3" ]; then - printf '\nERR: Bad %s (%s)\n\nexpected: %s\ngot: %s\n' \ - "$1" "$2" "$3" "$(cat "$2")" >&2 + printf '\n%s: Bad %s (%s)\n\nexpected: %s\ngot: %s\n' \ + "$(ERROR)" "$1" "$2" "$3" "$(cat "$2")" >&2 print_debug_info exit 1 fi @@ -76,8 +77,8 @@ assert_stderr() { assert_grep_stream() { if ! grep -qE "$3" "$2"; then - printf '\nERR: Bad %s (%s)\n\ngrepping: %s\nin:\n%s\n' \ - "$1" "$2" "$3" "$(cat "$2")" >&2 + printf '\n%s: Bad %s (%s)\n\ngrepping: %s\nin:\n%s\n' \ + "$(ERROR)" "$1" "$2" "$3" "$(cat "$2")" >&2 print_debug_info exit 1 fi @@ -93,8 +94,8 @@ assert_grep_stderr() { assert_fgrep_stream() { if ! grep -Fq -- "$3" "$2"; then - printf '\nERR: Bad %s (%s)\n\ngrepping: %s\nin:\n%s\n' \ - "$1" "$2" "$3" "$(cat "$2")" >&2 + printf '\n%s: Bad %s (%s)\n\ngrepping: %s\nin:\n%s\n' \ + "$(ERROR)" "$1" "$2" "$3" "$(cat "$2")" >&2 print_debug_info exit 1 fi |