Fix missing fixed wing throttle control.
[betaflight.git] / .travis.sh
blobee8fcb5925cc699b602206f6fd23511c529fcdc4
1 #!/bin/bash
2 REVISION=$(git rev-parse --short HEAD)
3 BRANCH=$(git rev-parse --abbrev-ref HEAD)
4 REVISION=$(git rev-parse --short HEAD)
5 LAST_COMMIT_DATE=$(git log -1 --date=short --format="%cd")
6 TARGET_FILE=obj/cleanflight_${TARGET}
7 REPONAME=${TRAVIS_REPO_SLUG:=$USER/undefined}
8 BUILDNAME=${BUILDNAME:=travis}
11 # A hacky way of running the unit tests at the same time as the normal builds.
12 if [ $RUNTESTS ] ; then
13 cd ./src/test && make test
15 # A hacky way of building the docs at the same time as the normal builds.
16 elif [ $PUBLISHDOCS ] ; then
17 if [ $PUBLISH_URL ] ; then
19 sudo apt-get install zlib1g-dev libssl-dev wkhtmltopdf libxml2-dev libxslt-dev #ruby-rvm
21 # Patch Gimli to fix underscores_inside_words
22 curl -L https://github.com/walle/gimli/archive/v0.5.9.tar.gz | tar zxf -
24 sed -i 's/).render(/, :no_intra_emphasis => true).render(/' gimli-0.5.9/ext/github_markup.rb
26 cd gimli-0.5.9/
27 gem build gimli.gemspec && rvmsudo gem install gimli
28 cd ../
30 ./build_docs.sh
32 curl -k \
33 --form "manual=@docs/Manual.pdf" \
34 --form "revision=${REVISION}" \
35 --form "branch=${BRANCH}" \
36 --form "last_commit_date=${LAST_COMMIT_DATE}" \
37 --form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
38 --form "github_repo=${REPONAME}" \
39 --form "build_name=${BUILDNAME}" \
40 ${PUBLISH_URL}
43 elif [ $PUBLISHMETA ] ; then
44 if [ $PUBLISH_URL ] ; then
45 RECENT_COMMITS=$(git shortlog -n25)
46 curl -k \
47 --form "recent_commits=${RECENT_COMMITS}" \
48 --form "revision=${REVISION}" \
49 --form "branch=${BRANCH}" \
50 --form "last_commit_date=${LAST_COMMIT_DATE}" \
51 --form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
52 --form "github_repo=${REPONAME}" \
53 --form "build_name=${BUILDNAME}" \
54 ${PUBLISH_URL}
57 else
58 if [ $PUBLISH_URL ] ; then
59 make -j2
60 if [ -f ${TARGET_FILE}.bin ] ; then
61 TARGET_FILE=${TARGET_FILE}.bin
62 elif [ -f ${TARGET_FILE}.hex ] ; then
63 TARGET_FILE=${TARGET_FILE}.hex
64 else
65 echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting";
66 exit 1
69 curl -k \
70 --form "file=@${TARGET_FILE}" \
71 --form "revision=${REVISION}" \
72 --form "branch=${BRANCH}" \
73 --form "last_commit_date=${LAST_COMMIT_DATE}" \
74 --form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
75 --form "github_repo=${REPONAME}" \
76 --form "build_name=${BUILDNAME}" \
77 ${PUBLISH_URL}
78 else
79 make -j2