ACTION=${1}
IMPL=${2}
+# Environment variable configuration
BUILD_IMPL=${BUILD_IMPL:-${IMPL}}
+TEST_OPTS="${TEST_OPTS} --debug-file ../${ACTION}.err"
-# Special tags/branches
-case "${TRAVIS_BRANCH}" in
-self-host-test)
+if [ "${DO_SELF_HOST}" ]; then
MAL_IMPL=${IMPL}
IMPL=mal
- ;;
-esac
-
-mode_var=${MAL_IMPL:-${IMPL}}_MODE
-mode_val=${!mode_var}
+fi
+if [ "${DO_HARD}" ]; then
+ TEST_OPTS="${TEST_OPTS} --hard"
+fi
echo "ACTION: ${ACTION}"
echo "IMPL: ${IMPL}"
echo "BUILD_IMPL: ${BUILD_IMPL}"
echo "MAL_IMPL: ${MAL_IMPL}"
-if [ "${MAL_IMPL}" ]; then
+if [ "${DO_SELF_HOST}" ]; then
if [ "${NO_SELF_HOST}" ]; then
echo "Skipping ${ACTION} of ${MAL_IMPL} self-host"
exit 0
fi
fi
+mode_var=${MAL_IMPL:-${IMPL}}_MODE
+mode_val=${!mode_var}
+
MAKE="make ${mode_val:+${mode_var}=${mode_val}}"
# If NO_DOCKER is blank then launch use a docker image, otherwise use
${MAKE} -C ${BUILD_IMPL}
;;
test|perf)
- if ! ${MAKE} TEST_OPTS="--debug-file ../${ACTION}.err" \
+ [ "${ACTION}" = "perf" ] && STEP=
+ if ! ${MAKE} TEST_OPTS="${TEST_OPTS}" \
${MAL_IMPL:+MAL_IMPL=${MAL_IMPL}} \
- ${ACTION}^${IMPL}; then
+ ${REGRESS:+REGRESS=${REGRESS}} \
+ ${ACTION}^${IMPL}${STEP:+^${STEP}}; then
# print debug-file on error
cat ${ACTION}.err
false
fi
;;
esac
-
-
parser.add_argument('--debug-file', type=str,
help="Write all test interaction the named file")
parser.add_argument('--hard', action='store_true',
- help="Turn soft tests following a ';>>> soft=True' into hard failures")
+ help="Turn soft tests (soft, deferrable, optional) into hard failures")
# Control whether deferrable and optional tests are executed
parser.add_argument('--deferrable', dest='deferrable', action='store_true',
--- /dev/null
+#!/bin/bash
+
+set -e
+
+die() { echo "${*}"; exit 1; }
+usage() {
+ [ "${*}" ] && echo >&2 -e "${*}\n"
+ echo "Usage: $0 REPO BRANCH [VAR=VAL]...
+
+ Examples:
+
+ Trigger build/test in self-hosted mode:
+ $0 REPO BRANCH DO_SELF_HOST=1
+
+ Trigger build/test with stop on soft failures:
+ $0 REPO BRANCH DO_HARD=1
+
+ Trigger build/test using regress mode on stepA:
+ $0 REPO BRANCH REGRESS=1 STEP=stepA
+
+ Trigger build/test using regress mode on all steps:
+ $0 REPO BRANCH REGRESS=1
+ " | sed 's/^ //' >&2
+
+ exit 2
+}
+
+REPO="${1}"; shift || usage "REPO required"
+BRANCH="${1}"; shift || usage "BRANCH required"
+VARS="${*}"
+
+repo="${REPO/\//%2F}"
+vars=""
+[ "${VARS}" ] && vars="\"${VARS// /\", \"}\""
+
+body="{
+ \"request\": {
+ \"message\": \"Manual build. Settings: ${VARS}\",
+ \"branch\":\"${BRANCH}\",
+ \"config\": {
+ \"env\": {
+ \"global\": [${vars}]
+ }
+ }
+ }
+}"
+
+token="$(travis token --org --no-interactive)"
+
+curl -X POST \
+ -H "Content-Type: application/json" \
+ -H "Accept: application/json" \
+ -H "Travis-API-Version: 3" \
+ -H "Authorization: token ${token}" \
+ -d "$body" \
+ "https://api.travis-ci.org/repo/${repo}/requests"