diff options
Diffstat (limited to 'aux/ci')
-rwxr-xr-x | aux/ci/ci-build.sh | 12 | ||||
-rwxr-xr-x | aux/ci/git-post-receive.sh | 5 | ||||
-rwxr-xr-x | aux/ci/git-pre-push.sh | 2 | ||||
-rwxr-xr-x | aux/ci/report.sh | 54 |
4 files changed, 43 insertions, 30 deletions
diff --git a/aux/ci/ci-build.sh b/aux/ci/ci-build.sh index 17e9e37..2ec0102 100755 --- a/aux/ci/ci-build.sh +++ b/aux/ci/ci-build.sh @@ -8,7 +8,8 @@ FILENAME="$(date -Is)-$SHA.log" LOGFILE="$LOGS_DIR/$FILENAME" mkdtemp() { - name="$(echo 'mkstemp(template)' | m4 -D template="${TMPDIR:-/tmp}/m4-tmpname.")" + name="$(echo 'mkstemp(template)' | + m4 -D template="${TMPDIR:-/tmp}/m4-tmpname.")" rm -f "$name" mkdir "$name" echo "$name" @@ -37,7 +38,13 @@ EOF sh aux/ci/report.sh -n "$PROJECT" -o public rsync -av public/ "/srv/http/$PROJECT/" --delete - printf "\n>>>\n>>> CI logs added as Git note.\n>>>\n>>> Run status was %s\n\n" "$STATUS" + 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.\n>>>\n>>> Run status was %s\n>>>\n\n' \ + "$STATUS" } trap finish EXIT @@ -47,7 +54,6 @@ EOF git clone "$REMOTE" . git config --global user.email git@euandre.org git config --global user.name 'EuAndreh CI' - git annex get ||: if [ -f aux/guix/with-container.sh ]; then RUNNER='sh aux/guix/with-container.sh' diff --git a/aux/ci/git-post-receive.sh b/aux/ci/git-post-receive.sh index b8584bf..92bba73 100755 --- a/aux/ci/git-post-receive.sh +++ b/aux/ci/git-post-receive.sh @@ -4,7 +4,8 @@ set -eu for n in $(seq 0 $((GIT_PUSH_OPTION_COUNT - 1))); do opt="$(eval "echo \$GIT_PUSH_OPTION_$n")" if [ "$opt" = skip-ci ] || [ "$opt" = ci-skip ]; then - printf "\n'%s' option detected, not running ci-build.sh\n\n" "$opt" + printf "\n'%s' option detected, not running ci-build.sh\n\n" \ + "$opt" exit 0 fi done @@ -17,5 +18,5 @@ LOGS_DIR="/opt/ci/$PROJECT/logs" sh "/opt/ci/$PROJECT/ci-build.sh" "$PROJECT" "$LOGS_DIR" "$SHA" ||: echo 'To retrigger the build, run:' -echo "cd /srv/git/$PROJECT.git/" +echo "cd /srv/http/$PROJECT.git/" echo "sh /opt/ci/$PROJECT/ci-build.sh" "$PROJECT" "$LOGS_DIR" "$SHA" diff --git a/aux/ci/git-pre-push.sh b/aux/ci/git-pre-push.sh index 4fcf733..eaaa7bd 100755 --- a/aux/ci/git-pre-push.sh +++ b/aux/ci/git-pre-push.sh @@ -6,7 +6,7 @@ TLD="$(cat aux/tld.txt)" PROJECT="$(basename "$PWD")" LOGS_DIR="/opt/ci/$PROJECT/logs" -REMOTE_GIT_DIR="/srv/git/$PROJECT.git" +REMOTE_GIT_DIR="/srv/http/$PROJECT.git" DESCRIPTION="$(mkstemp)" if [ -f description ] diff --git a/aux/ci/report.sh b/aux/ci/report.sh index 1aa41a0..6f18f0f 100755 --- a/aux/ci/report.sh +++ b/aux/ci/report.sh @@ -41,29 +41,36 @@ 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" > "$OUTDIR/ci-data/$FILENAME" - git notes --ref=refs/notes/ci-logs show "$c" > "$OUTDIR/ci-logs/$FILENAME" + git notes --ref=refs/notes/ci-logs show "$c" \ + > "$OUTDIR/ci-logs/$FILENAME" done cat <<EOF >> "$OUT" <!DOCTYPE html> <html lang="en"> - <head> - <meta charset="UTF-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <link rel="icon" type="image/svg+xml" href="favicon.svg" /> - <title>CI logs for $PROJECT</title> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <meta name="description" content="CI logs for $PROJECT" /> + <link rel="icon" type="image/svg+xml" href="favicon.svg" /> + <title>$PROJECT - CI logs</title> - <style> - pre { - display: inline; - } - </style> - </head> - <body> - <h1> - CI logs for <a href="https://$TLD/$PROJECT/en/">$PROJECT</a> - </h1> - <ul> + <style> + pre { + display: inline; + } + ol { + list-style-type: disc; + } + </style> + </head> + <body> + <main> + <h1> + CI logs for + <a href="https://$TLD/$PROJECT/en/">$PROJECT</a> + </h1> + <ol> EOF for f in $(find "$OUTDIR/ci-data/" -type f | LANG=C.UTF-8 sort -r); do @@ -78,17 +85,16 @@ for f in $(find "$OUTDIR/ci-data/" -type f | LANG=C.UTF-8 sort -r); do fi cat <<EOF >> "$OUT" - <li> - <a href="ci-logs/$FILENAME"> - $STATUS_MARKER <pre>$FILENAME</pre> - </a> - </li> + <li> + <a href="ci-logs/$FILENAME">$STATUS_MARKER <pre>$FILENAME</pre></a> + </li> EOF done cat <<EOF >> "$OUT" - </ul> - </body> + </ol> + </main> + </body> </html> EOF |