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}
11 MAKEFILE
="-f Makefile"
15 "--retry-max-time" "120" )
18 "--form" "revision=${REVISION}"
19 "--form" "branch=${BRANCH}"
20 "--form" "travis_build_number=${TRAVIS_BUILD_NUMBER}"
21 "--form" "last_commit_date=${LAST_COMMIT_DATE}"
22 "--form" "github_repo=${TRAVIS_REPO_SLUG}"
23 "--form" "build_name=${BUILDNAME}" )
25 # A hacky way of running the unit tests at the same time as the normal builds.
26 if [ $RUNTESTS ] ; then
27 cd .
/src
/test && make test
29 # A hacky way of building the docs at the same time as the normal builds.
30 elif [ $PUBLISHDOCS ] ; then
31 if [ $PUBLISH_URL ] ; then
33 # Patch Gimli to fix underscores_inside_words
34 curl
-L "${CURL_BASEOPTS[@]}" https
://github.com
/walle
/gimli
/archive
/v0.5
.9.
tar.gz |
tar zxf
-
36 sed -i 's/).render(/, :no_intra_emphasis => true).render(/' gimli-0.5
.9/ext
/github_markup.rb
39 gem build gimli.gemspec
&& gem
install gimli
44 curl
-k "${CURL_BASEOPTS[@]}" "${CURL_PUB_BASEOPTS[@]}" --form "manual=@docs/Manual.pdf" ${PUBLISH_URL} || true
47 elif [ $PUBLISHMETA ] ; then
48 if [ $PUBLISH_URL ] ; then
49 RECENT_COMMITS=$(git shortlog -n25)
50 curl -k "${CURL_BASEOPTS[@]}" "${CURL_PUB_BASEOPTS[@]}" --form "recent_commits=${RECENT_COMMITS}" ${PUBLISH_URL} || true
54 if [ $PUBLISH_URL ] ; then
56 if [ -f ${TARGET_FILE}.bin
] ; then
57 TARGET_FILE
=${TARGET_FILE}.bin
58 elif [ -f ${TARGET_FILE}.hex
] ; then
59 TARGET_FILE
=${TARGET_FILE}.hex
61 echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting";
65 curl
-k "${CURL_BASEOPTS[@]}" "${CURL_PUB_BASEOPTS[@]}" --form "file=@${TARGET_FILE}" ${PUBLISH_URL} || true