#!/usr/bin/env bash # # a simple ci that saves its results in a git note, formatted according to # RFC-2822, more or less. # ## set -uo pipefail [[ -n $(git status -s) ]] && { echo fail: dirty worktree; exit 1; } ## at=$(date -R) user=$(git config --get user.name) mail=$(git config --get user.email) ## if lint "${BIZ_ROOT:?}"/**/* then lint_result="good" else lint_result="fail" fi ## read -r -d '' note < Lint-at: $at EOF git notes --ref=ci append -m "$note" ## if bild --test "${BIZ_ROOT:?}"/**/* then test_result="good" else test_result="fail" fi ## read -r -d '' note < Test-at: $at EOF git notes --ref=ci append -m "$note" ##