summaryrefslogtreecommitdiff
path: root/.travis.sh
diff options
context:
space:
mode:
authorBryan Hundven <bryanhundven@gmail.com>2015-10-07 20:29:30 (GMT)
committerBryan Hundven <bryanhundven@gmail.com>2015-10-07 20:29:30 (GMT)
commit5f2d69fb9daed3eac80cc3d2c222ffd13d431c14 (patch)
tree6ab7673c221579ca3e63bf7618d2b3a61fc8941f /.travis.sh
parentb565e949d4d9eb695d026a963aa537f0d0992291 (diff)
parent6b0fa2221a782504a0f1d6907e8c492e3a09d5d1 (diff)
Merge pull request #202 from jmlemetayer/travis_build
Manage Travis-CI build
Diffstat (limited to '.travis.sh')
-rw-r--r--.travis.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/.travis.sh b/.travis.sh
new file mode 100644
index 0000000..90a439b
--- /dev/null
+++ b/.travis.sh
@@ -0,0 +1,45 @@
+# Add current directory to PATH
+export PATH="$(pwd):$PATH"
+
+# Manage the travis build
+ct-ng_travis_build()
+{
+ # Override the log behaviour
+ sed -i -e 's/^.*\(CT_LOG_ERROR\).*$/# \1 is not set/' \
+ -e 's/^.*\(CT_LOG_WARN\).*$/# \1 is not set/' \
+ -e 's/^.*\(CT_LOG_INFO\).*$/# \1 is not set/' \
+ -e 's/^.*\(CT_LOG_EXTRA\).*$/\1=y/' \
+ -e 's/^.*\(CT_LOG_ALL\).*$/# \1 is not set/' \
+ -e 's/^.*\(CT_LOG_DEBUG\).*$/# \1 is not set/' \
+ -e 's/^.*\(CT_LOG_LEVEL_MAX\).*$/\1="EXTRA"/' \
+ -e 's/^.*\(CT_LOG_PROGRESS_BAR\).*$/# \1 is not set/' \
+ -e 's/^.*\(CT_LOCAL_TARBALLS_DIR\).*$/\1="${HOME}\/src"/' \
+ -e 's/^.*\(CT_SAVE_TARBALLS\).*$/\1=y/' \
+ .config
+
+ # Build the sample
+ ct-ng build.2 &
+ local build_pid=$!
+
+ # Start a runner task to print a "still running" line every 5 minutes
+ # to avoid travis to think that the build is stuck
+ {
+ while true
+ do
+ sleep 300
+ printf "Crosstool-NG is still running ...\r"
+ done
+ } &
+ local runner_pid=$!
+
+ # Wait for the build to finish and get the result
+ wait $build_pid 2>/dev/null
+ local result=$?
+
+ # Stop the runner task
+ kill $runner_pid
+ wait $runner_pid 2>/dev/null
+
+ # Return the result
+ return $result
+}