-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding buildkite support * Update build.sh to support all flag
- Loading branch information
1 parent
ae1e299
commit 1996b57
Showing
3 changed files
with
67 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
steps: | ||
- label: 'Tests' | ||
command: "./run_tests_update_status.sh \"${UPDATE_STATUS_PATH}\" \"${BUILDKITE_PULL_REQUEST}\" \"${BUILDKITE_BUILD_URL}\"" | ||
timeout_in_minutes: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
set -eo pipefail | ||
|
||
UPDATE_STATUS_PATH=$1 | ||
BUILDKITE_PULL_REQUEST=$2 | ||
BUILDKITE_BUILD_URL=$3 | ||
|
||
function updateStatus() { | ||
if [ "${BUILDKITE_PULL_REQUEST}" != "false" ] ; then | ||
${UPDATE_STATUS_PATH} "TextureGroup" "Texture" ${BUILDKITE_PULL_REQUEST} "$1" ${BUILDKITE_BUILD_URL} "$2" "CI/Pinterest" "$3" | ||
fi | ||
} | ||
|
||
if [[ -z "${UPDATE_STATUS_PATH}" || -z "${BUILDKITE_PULL_REQUEST}" || -z "${BUILDKITE_BUILD_URL}" ]] ; then | ||
echo "Update status path (${UPDATE_STATUS_PATH}), pull request (${BUILDKITE_BUILD_URL}) or build url (${BUILDKITE_PULL_REQUEST}) unset." | ||
trap - EXIT | ||
exit 255 | ||
fi | ||
|
||
trapped="false" | ||
function trap_handler() { | ||
if [[ "$trapped" = "false" ]]; then | ||
updateStatus "failure" "Tests failed…" `pwd`/log.txt | ||
echo "Tests failed, updated status to failure" | ||
rm `pwd`/log.txt | ||
fi | ||
trapped="true" | ||
} | ||
trap trap_handler INT TERM EXIT | ||
|
||
updateStatus "pending" "Starting build…" | ||
|
||
./build.sh all 2>&1|tee `pwd`/log.txt | ||
|
||
rm `pwd`/log.txt | ||
|
||
updateStatus "success" "Tests passed" | ||
|
||
echo "All tests succeeded, updated status to success" | ||
trap - EXIT | ||
exit 0 |