diff options
Diffstat (limited to 'aux/ci')
-rwxr-xr-x | aux/ci/ci-build.sh | 9 | ||||
-rwxr-xr-x | aux/ci/git-pre-push.sh | 3 | ||||
-rwxr-xr-x | aux/ci/report.sh | 4 |
3 files changed, 13 insertions, 3 deletions
diff --git a/aux/ci/ci-build.sh b/aux/ci/ci-build.sh index be97866..74e9558 100755 --- a/aux/ci/ci-build.sh +++ b/aux/ci/ci-build.sh @@ -7,6 +7,13 @@ read -r _ SHA _ # oldrev newrev refname 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)" @@ -35,7 +42,7 @@ EOF 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' diff --git a/aux/ci/git-pre-push.sh b/aux/ci/git-pre-push.sh index cccd6e5..4fcf733 100755 --- a/aux/ci/git-pre-push.sh +++ b/aux/ci/git-pre-push.sh @@ -2,12 +2,13 @@ set -eux TLD="$(cat aux/tld.txt)" +. aux/lib.sh PROJECT="$(basename "$PWD")" LOGS_DIR="/opt/ci/$PROJECT/logs" REMOTE_GIT_DIR="/srv/git/$PROJECT.git" -DESCRIPTION="$(mktemp)" +DESCRIPTION="$(mkstemp)" if [ -f description ] then cp description "$DESCRIPTION" diff --git a/aux/ci/report.sh b/aux/ci/report.sh index 710451c..a90d10a 100755 --- a/aux/ci/report.sh +++ b/aux/ci/report.sh @@ -2,6 +2,8 @@ set -eu TLD="$(cat aux/tld.txt)" +. aux/lib.sh + while getopts 'n:o:' flag; do case "$flag" in n) @@ -32,7 +34,7 @@ FAIL='❌' mkdir -p "$OUTDIR/ci-logs" "$OUTDIR/ci-data" -OUT="$(mktemp)" +OUT="$(mkstemp)" chmod 644 "$OUT" git fetch origin refs/notes/ci-data:refs/notes/ci-data ||: & |