#!/usr/bin/env bash set -Eeuo pipefail set -x PREFIX='/srv/ci/vps' mkdir -p "$PREFIX" read -r _ SHA _ # oldrev newrev refname FILENAME="$(date -Is)-$SHA.log" LOGFILE="$PREFIX/$FILENAME" exec &> >(tee -a "$LOGFILE") echo "Starting CI job at: $(date -Is)" finish() { STATUS="$?" printf "\n\n>>> exit status was %s\n" "$STATUS" echo "Finishing CI job at: $(date -Is)" popd NOTE=$(cat <>> CI logs added as Git note." } trap finish EXIT unset GIT_DIR CLONE="$(mktemp -d)" git clone . "$CLONE" pushd "$CLONE" git config --global user.email git@euandre.org git config --global user.name 'EuAndreh CI' ./container make check site ./container make publish