aboutsummaryrefslogtreecommitdiff
path: root/aux/ci/ci-build.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xaux/ci/ci-build.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/aux/ci/ci-build.sh b/aux/ci/ci-build.sh
index be97866..17e9e37 100755
--- a/aux/ci/ci-build.sh
+++ b/aux/ci/ci-build.sh
@@ -3,10 +3,17 @@ set -eux
PROJECT="$1"
LOGS_DIR="$2"
-read -r _ SHA _ # oldrev newrev refname
+SHA="$3"
FILENAME="$(date -Is)-$SHA.log"
LOGFILE="$LOGS_DIR/$FILENAME"
+mkdtemp() {
+ name="$(echo 'mkstemp(template)' | m4 -D template="${TMPDIR:-/tmp}/m4-tmpname.")"
+ rm -f "$name"
+ mkdir "$name"
+ echo "$name"
+}
+
{
echo "Starting CI job at: $(date -Is)"
@@ -26,24 +33,24 @@ EOF
git notes append -m "$NOTE"
cd -
+ git fetch origin refs/notes/*:refs/notes/*
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" "$STATUS"
+ printf "\n>>>\n>>> CI logs added as Git note.\n>>>\n>>> Run status was %s\n\n" "$STATUS"
}
trap finish EXIT
unset GIT_DIR
REMOTE="$PWD"
- cd "$(mktemp -d)"
+ cd "$(mkdtemp)"
git clone "$REMOTE" .
git config --global user.email git@euandre.org
git config --global user.name 'EuAndreh CI'
- git fetch origin refs/notes/*:refs/notes/*
git annex get ||:
if [ -f aux/guix/with-container.sh ]; then
- RUNNER='./aux/guix/with-container.sh'
+ RUNNER='sh aux/guix/with-container.sh'
else
RUNNER='sh -c'
fi