cockpit/.tasks

40 lines
998 B
Bash
Executable File

#!/bin/sh
# Tasks file
# This file produces the possible set of bot tasks to be executed in the
# current repository by bots. Empty lines and commented lines are ignored
# and commented lines are removed. If this file is executable it will be
# run, and the output will be used as the list of tasks.
# The tasks are sorted descending alphabetically and a task is chosen from
# near the top of the sorted result. The task will be run in a shell by the
# Cockpit bots.
set -ex
# Consume item from task queue or scan for all tests
if [ -n "$AMQP_SERVER" ]; then
echo bots/run-queue --amqp "$AMQP_SERVER"
else
bots/tests-scan
# Any tasks related to issues
bots/issue-scan
fi
# When run automated, randomize to minimize stampeding herd
if [ -t 0 ]; then
chance=10
else
chance=$(shuf -i 0-10 -n 1)
fi
# File issues for these tasks
if [ $chance -gt 9 ]; then
bots/po-trigger
bots/image-trigger
bots/npm-trigger
bots/naughty-trigger
bots/learn-trigger
fi