3 REVISION
=$
(git rev-parse
--short HEAD
)
4 BRANCH
=$
(git rev-parse
--abbrev-ref HEAD
)
5 REVISION
=$
(git rev-parse
--short HEAD
)
6 LAST_COMMIT_DATE
=$
(git log
-1 --date=short
--format="%cd")
7 TARGET_FILE
=obj
/cleanflight_
${TARGET}
8 TRAVIS_REPO_SLUG
=${TRAVIS_REPO_SLUG:=$USER/undefined}
9 BUILDNAME
=${BUILDNAME:=travis}
10 TRAVIS_BUILD_NUMBER
=${TRAVIS_BUILD_NUMBER:=undefined}
14 "--retry-max-time" "120" )
17 "--form" "revision=${REVISION}"
18 "--form" "branch=${BRANCH}"
19 "--form" "travis_build_number=${TRAVIS_BUILD_NUMBER}"
20 "--form" "last_commit_date=${LAST_COMMIT_DATE}"
21 "--form" "github_repo=${TRAVIS_REPO_SLUG}"
22 "--form" "build_name=${BUILDNAME}" )
24 # A hacky way of running the unit tests at the same time as the normal builds.
25 if [ $RUNTESTS ] ; then
26 cd .
/src
/test && make test
27 # A hacky way of building the docs at the same time as the normal builds.
28 elif [ $PUBLISHDOCS ] ; then
29 if [ $PUBLISH_URL ] ; then
31 # Patch Gimli to fix underscores_inside_words
32 curl
-L "${CURL_BASEOPTS[@]}" https
://github.com
/walle
/gimli
/archive
/v0.5
.9.
tar.gz |
tar zxf
-
34 sed -i 's/).render(/, :no_intra_emphasis => true).render(/' gimli-0.5
.9/ext
/github_markup.rb
37 gem build gimli.gemspec
&& gem
install gimli
42 curl
-k "${CURL_BASEOPTS[@]}" "${CURL_PUB_BASEOPTS[@]}" --form "manual=@docs/Manual.pdf" ${PUBLISH_URL} || true
44 elif [ $PUBLISHMETA ] ; then
45 if [ $PUBLISH_URL ] ; then
46 RECENT_COMMITS=$(git shortlog -n25)
47 curl -k "${CURL_BASEOPTS[@]}" "${CURL_PUB_BASEOPTS[@]}" --form "recent_commits=${RECENT_COMMITS}" ${PUBLISH_URL} || true
49 elif [ $TARGET ] ; then
50 if [ $PUBLISH_URL ] ; then
52 if [ -f ${TARGET_FILE}.bin
] ; then
53 TARGET_FILE
=${TARGET_FILE}.bin
54 elif [ -f ${TARGET_FILE}.hex
] ; then
55 TARGET_FILE
=${TARGET_FILE}.hex
57 echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting";
61 curl
-k "${CURL_BASEOPTS[@]}" "${CURL_PUB_BASEOPTS[@]}" --form "file=@${TARGET_FILE}" ${PUBLISH_URL} || true
69 # No target specified, build all with very low verbosity.