aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/lib/test_repo/ci.sh
blob: 804cdb3eee9472f292bd7779a9cde801a0d3cc41 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash

set -o errexit -o nounset -o pipefail
shopt -s inherit_errexit lastpipe

script_dir="$( dirname -- "${BASH_SOURCE[0]}" )"
script_dir="$( cd -- "$script_dir" && pwd )"
readonly script_dir

ci_output_dir="$( git remote get-url origin )"
ci_output_dir="$ci_output_dir/output"
readonly ci_output_dir

mkdir -p -- "$ci_output_dir"

readonly ci_output_template=ci_XXXXXX

ci_output_path="$( mktemp --tmpdir="$ci_output_dir" "$ci_output_template" )"
readonly ci_output_path

timestamp="$( date --iso-8601=ns )"
readonly timestamp

echo "A CI run happened at $timestamp" | tee -- "$ci_output_path"