4 REVISION
=$
(git rev-parse
--short HEAD
)
5 BRANCH
=$
(git rev-parse
--abbrev-ref HEAD
)
6 REVISION
=$
(git rev-parse
--short HEAD
)
7 LAST_COMMIT_DATE
=$
(git log
-1 --date=short
--format="%cd")
8 TARGET_FILE
=obj
/betaflight_
${FC_VER}_
${TARGET}
9 TRAVIS_REPO_SLUG
=${TRAVIS_REPO_SLUG:=$USER/undefined}
10 BUILDNAME
=${BUILDNAME:=travis}
11 TRAVIS_BUILD_NUMBER
=${TRAVIS_BUILD_NUMBER:=undefined}
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 building the docs at the same time as the normal builds.
26 if [ $PUBLISHDOCS ] ; then
27 if [ $PUBLISH_URL ] ; then
29 # Patch Gimli to fix underscores_inside_words
30 curl
-L "${CURL_BASEOPTS[@]}" https
://github.com
/walle
/gimli
/archive
/v0.5
.9.
tar.gz |
tar zxf
-
32 sed -i 's/).render(/, :no_intra_emphasis => true).render(/' gimli-0.5
.9/ext
/github_markup.rb
35 gem build gimli.gemspec
&& gem
install gimli
40 curl
-k "${CURL_BASEOPTS[@]}" "${CURL_PUB_BASEOPTS[@]}" --form "manual=@docs/Manual.pdf" ${PUBLISH_URL} || true
43 elif [ $PUBLISHMETA ] ; then
44 if [ $PUBLISH_URL ] ; then
45 RECENT_COMMITS=$(git shortlog -n25)
46 curl -k "${CURL_BASEOPTS[@]}" "${CURL_PUB_BASEOPTS[@]}" --form "recent_commits=${RECENT_COMMITS}" ${PUBLISH_URL} || true
49 elif [ $TARGET ] ; then
50 make $TARGET ||
exit $?
52 if [ $PUBLISH_URL ] ; then
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
58 echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting";
62 curl
-k "${CURL_BASEOPTS[@]}" "${CURL_PUB_BASEOPTS[@]}" --form "file=@${TARGET_FILE}" ${PUBLISH_URL} || true