aboutsummaryrefslogtreecommitdiff
path: root/aux/ci/ci-build.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-07-25 15:16:31 -0300
committerEuAndreh <eu@euandre.org>2021-07-25 15:16:31 -0300
commit7400e108286a0fceacdac63b125fdc924c2dd50c (patch)
tree4849176606778477ead8a9ded4c9ff43bf4a8feb /aux/ci/ci-build.sh
parentservers/nixvps/configuration.nix: Serve Git repositories from NGINX, remove G... (diff)
downloadserver-7400e108286a0fceacdac63b125fdc924c2dd50c.tar.gz
server-7400e108286a0fceacdac63b125fdc924c2dd50c.tar.xz
aux/: Update
Diffstat (limited to '')
-rwxr-xr-xaux/ci/ci-build.sh23
1 files changed, 15 insertions, 8 deletions
diff --git a/aux/ci/ci-build.sh b/aux/ci/ci-build.sh
index b6769a9..17e9e37 100755
--- a/aux/ci/ci-build.sh
+++ b/aux/ci/ci-build.sh
@@ -1,12 +1,19 @@
#!/bin/sh
set -eux
-PACKAGE="$1"
+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 -
- sh aux/ci/report.sh "$PACKAGE"
- rsync -a public/ "/srv/http/$PACKAGE/" --delete
+ 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