aboutsummaryrefslogtreecommitdiff
path: root/aux/ci/ci-build.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-07-23 15:13:23 -0300
committerEuAndreh <eu@euandre.org>2021-07-23 15:13:23 -0300
commit3a94df050166da6bf9fc3fda584b69816779d865 (patch)
tree145f6767d7afeeca9b4e0524c14a0758209f6e7a /aux/ci/ci-build.sh
parentTODOs.md: Mark #task-bd165b74-c559-48ee-1d29-eaa906aa0393 as DONE (diff)
downloadremembering-3a94df050166da6bf9fc3fda584b69816779d865.tar.gz
remembering-3a94df050166da6bf9fc3fda584b69816779d865.tar.xz
aux/: Update
Diffstat (limited to 'aux/ci/ci-build.sh')
-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