Skip to main content

ci/run_post_receive_checks.sh

1#!/usr/bin/env bash
3set -o errexit
4set -o nounset
6if (( $# != 1 )); then
7 echo "Usage: $0 REPO_NAME" >&2
8 exit 1
9fi
11# REPO_NAME is the name of the repository to run tests for
12REPO_NAME="$1"
14NOW=$(date +'%Y-%m-%dT%H-%M-%S')
15LOG_NAME="$REPO_NAME.$NOW.log"
16LOG_PATH="$TMPDIR/$LOG_NAME"
18touch $LOG_PATH
20echo "Running tests"
21echo "Follow logs: tail -f \$TMPDIR/$LOG_NAME"
23if bash ~/repos/scripts/ci/post_receive_tests.sh "$REPO_NAME" > $LOG_PATH 2>&1; then
24 print_success "Post-receive tests passed!"
25else
26 print_error "Post-receive tests failed!"
27 cp "$LOG_PATH" ~/Desktop/$REPO_NAME.$NOW.failed.log
28 print_error "See logs: cat ~/Desktop/$REPO_NAME.$NOW.failed.log"
29 exit 1
30fi