Adding attributions for some of the Graupner SumH code.
[betaflight.git] / .travis.sh
blobb2ac4fdd61f92d8f73027ac2277461f31a3a8ecf
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}
8 # A hacky way of running the unit tests at the same time as the normal builds.
9 if [ $RUNTESTS ] ; then
10 cd ./src/test && make test
12 # A hacky way of building the docs at the same time as the normal builds.
13 elif [ $PUBLISHDOCS ] ; then
14 if [ $PUBLISH_URL ] ; then
16 sudo apt-get install zlib1g-dev libssl-dev wkhtmltopdf libxml2-dev libxslt-dev #ruby-rvm
18 # Patch Gimli to fix underscores_inside_words
19 curl -L https://github.com/walle/gimli/archive/v0.5.9.tar.gz | tar zxf -
21 sed -i 's/).render(/, :no_intra_emphasis => true).render(/' gimli-0.5.9/ext/github_markup.rb
23 cd gimli-0.5.9/
24 gem build gimli.gemspec && rvmsudo gem install gimli
25 cd ../
27 ./build_docs.sh
29 curl -k \
30 --form "manual=@docs/Manual.pdf" \
31 --form "revision=${REVISION}" \
32 --form "branch=${BRANCH}" \
33 --form "last_commit_date=${LAST_COMMIT_DATE}" \
34 --form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
35 ${PUBLISH_URL}
38 elif [ $PUBLISHMETA ] ; then
39 if [ $PUBLISH_URL ] ; then
40 RECENT_COMMITS=$(git shortlog -n25)
41 curl -k \
42 --form "recent_commits=${RECENT_COMMITS}" \
43 --form "revision=${REVISION}" \
44 --form "branch=${BRANCH}" \
45 --form "last_commit_date=${LAST_COMMIT_DATE}" \
46 --form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
47 ${PUBLISH_URL}
50 else
51 if [ $PUBLISH_URL ] ; then
52 make -j2
53 if [ -f ${TARGET_FILE}.bin ] ; then
54 TARGET_FILE=${TARGET_FILE}.bin
55 elif [ -f ${TARGET_FILE}.hex ] ; then
56 TARGET_FILE=${TARGET_FILE}.hex
57 else
58 echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting";
59 exit 1
62 curl -k \
63 --form "file=@${TARGET_FILE}" \
64 --form "revision=${REVISION}" \
65 --form "branch=${BRANCH}" \
66 --form "last_commit_date=${LAST_COMMIT_DATE}" \
67 --form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
68 ${PUBLISH_URL}
69 else
70 make -j2