From 2f13799914bb85e7537a5c23939291edd455c3c2 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 29 Nov 2020 01:18:47 -0300 Subject: Add scripts/ci-build.sh --- scripts/ci-build.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 scripts/ci-build.sh (limited to 'scripts') diff --git a/scripts/ci-build.sh b/scripts/ci-build.sh new file mode 100755 index 0000000..67bb59d --- /dev/null +++ b/scripts/ci-build.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +set -Eeuo pipefail +set -x + +read -r _ SHA _ # oldrev newrev refname +LOGFILE="/data/static/ci-logs/vps/$(date -Is)-$SHA.log" +mkdir -p "$(dirname "$LOGFILE")" +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 -- cgit v1.2.3