mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-10 07:20:56 +00:00
travis: also trigger trezor-mcu when running tests
because now it should be ALL GREEN
This commit is contained in:
parent
17b37034e8
commit
35b9ab898d
@ -2,9 +2,6 @@
|
|||||||
# adapted from https://github.com/stephanmg/travis-dependent-builds
|
# adapted from https://github.com/stephanmg/travis-dependent-builds
|
||||||
|
|
||||||
# variables
|
# variables
|
||||||
USER=trezor
|
|
||||||
REPO=trezor-core
|
|
||||||
BRANCH=master
|
|
||||||
SOURCE=trezor/python-trezor
|
SOURCE=trezor/python-trezor
|
||||||
|
|
||||||
if [ "$TRAVIS_REPO_SLUG" != "$SOURCE" ]; then
|
if [ "$TRAVIS_REPO_SLUG" != "$SOURCE" ]; then
|
||||||
@ -22,31 +19,42 @@ if [[ "$TRAVIS_JOB_NUMBER" != *.1 ]]; then
|
|||||||
exit 0;
|
exit 0;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MESSAGE=",\"message\": \"Triggered from upstream build of $TRAVIS_REPO_SLUG by commit "`git rev-parse --short HEAD`"\""
|
function trigger_build() {
|
||||||
|
USER="$1"
|
||||||
|
REPO="$2"
|
||||||
|
BRANCH="$3"
|
||||||
|
echo "attempting to trigger build of $USER/$REPO"
|
||||||
|
|
||||||
# curl POST request content body
|
MESSAGE=",\"message\": \"Triggered from upstream build of $TRAVIS_REPO_SLUG by commit "`git rev-parse --short HEAD`"\""
|
||||||
BODY="{
|
|
||||||
\"request\": {
|
|
||||||
\"branch\":\"$BRANCH\"
|
|
||||||
$MESSAGE
|
|
||||||
}}"
|
|
||||||
|
|
||||||
echo "attempting to trigger build of $USER/$REPO"
|
# curl POST request content body
|
||||||
# make a POST request with curl (note %2F could be replaced with
|
BODY="{
|
||||||
# / and additional curl arguments, however this works too!)
|
\"request\": {
|
||||||
curl -s -X POST \
|
\"branch\":\"$BRANCH\"
|
||||||
-H "Content-Type: application/json" \
|
$MESSAGE
|
||||||
-H "Accept: application/json" \
|
}}"
|
||||||
-H "Travis-API-Version: 3" \
|
|
||||||
-H "Authorization: token ${TRAVIS_TOKEN}" \
|
|
||||||
-d "$BODY" \
|
|
||||||
https://api.travis-ci.org/repo/${USER}%2F${REPO}/requests \
|
|
||||||
| tee /tmp/travis-request-output.$$.txt
|
|
||||||
|
|
||||||
if grep -q '"@type": "error"' /tmp/travis-request-output.$$.txt; then
|
# make a POST request with curl (note %2F could be replaced with
|
||||||
cat /tmp/travis-request-output.$$.txt
|
# / and additional curl arguments, however this works too!)
|
||||||
exit 1
|
curl -s -X POST \
|
||||||
elif grep -q 'access denied' /tmp/travis-request-output.$$.txt; then
|
-H "Content-Type: application/json" \
|
||||||
cat /tmp/travis-request-output.$$.txt
|
-H "Accept: application/json" \
|
||||||
exit 1
|
-H "Travis-API-Version: 3" \
|
||||||
fi
|
-H "Authorization: token ${TRAVIS_TOKEN}" \
|
||||||
|
-d "$BODY" \
|
||||||
|
https://api.travis-ci.org/repo/${USER}%2F${REPO}/requests \
|
||||||
|
| tee /tmp/travis-request-output.$$.txt
|
||||||
|
echo
|
||||||
|
|
||||||
|
if grep -q '"@type": "error"' /tmp/travis-request-output.$$.txt; then
|
||||||
|
cat /tmp/travis-request-output.$$.txt
|
||||||
|
exit 1
|
||||||
|
elif grep -q 'access denied' /tmp/travis-request-output.$$.txt; then
|
||||||
|
cat /tmp/travis-request-output.$$.txt
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# trigger both core and mcu
|
||||||
|
trigger_build trezor trezor-core master
|
||||||
|
trigger_build trezor trezor-mcu master
|
||||||
|
Loading…
Reference in New Issue
Block a user