aboutsummaryrefslogtreecommitdiff
path: root/aux/ci
diff options
context:
space:
mode:
Diffstat (limited to 'aux/ci')
-rwxr-xr-xaux/ci/ci-build.sh6
-rwxr-xr-xaux/ci/git-post-receive.sh6
-rwxr-xr-xaux/ci/git-pre-push.sh6
-rwxr-xr-xaux/ci/report.sh11
4 files changed, 15 insertions, 14 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"