diff options
author | EuAndreh <eu@euandre.org> | 2021-07-27 12:51:36 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-07-27 12:51:36 -0300 |
commit | 3bceeb4da5ec953309bbc3e61d04f078198966d2 (patch) | |
tree | c30ba0fd9485a88f45bdd91d3784630f9e9fa950 /aux/ci/ci-build.sh | |
parent | TODOs.md: Dump links on Scratch (diff) | |
download | gistatic-3bceeb4da5ec953309bbc3e61d04f078198966d2.tar.gz gistatic-3bceeb4da5ec953309bbc3e61d04f078198966d2.tar.xz |
aux/: Update, adjust Makefile
Diffstat (limited to 'aux/ci/ci-build.sh')
-rwxr-xr-x | aux/ci/ci-build.sh | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/aux/ci/ci-build.sh b/aux/ci/ci-build.sh index b6769a9..396fbff 100755 --- a/aux/ci/ci-build.sh +++ b/aux/ci/ci-build.sh @@ -1,12 +1,20 @@ #!/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 +34,25 @@ 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." + printf "\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 |