2015-01-23 16:39:26 -08:00
|
|
|
#!/bin/bash
|
2015-04-01 07:00:42 -07:00
|
|
|
REVISION=$(git rev-parse --short HEAD)
|
|
|
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
|
|
REVISION=$(git rev-parse --short HEAD)
|
|
|
|
LAST_COMMIT_DATE=$(git log -1 --date=short --format="%cd")
|
|
|
|
TARGET_FILE=obj/cleanflight_${TARGET}
|
|
|
|
|
2015-04-02 04:08:52 -07:00
|
|
|
# A hacky way of running the unit tests at the same time as the normal builds.
|
2015-01-23 16:39:26 -08:00
|
|
|
if [ $RUNTESTS ] ; then
|
|
|
|
cd ./src/test && make test
|
2015-04-01 07:00:42 -07:00
|
|
|
|
2015-04-03 07:02:12 -07:00
|
|
|
# A hacky way of running the unit tests at the same time as the normal builds.
|
|
|
|
elif [ $PUBLISHDOCS ] ; then
|
|
|
|
if [ $PUBLISH_URL ] ; then
|
|
|
|
|
|
|
|
sudo apt-get install zlib1g-dev libssl-dev wkhtmltopdf libxml2-dev libxslt-dev #ruby-rvm
|
|
|
|
rvmsudo gem install gimli
|
|
|
|
|
|
|
|
./build_docs.sh
|
|
|
|
|
|
|
|
curl -k \
|
|
|
|
--form "manual=@docs/Manual.pdf" \
|
|
|
|
--form "revision=${REVISION}" \
|
|
|
|
--form "branch=${BRANCH}" \
|
|
|
|
--form "last_commit_date=${LAST_COMMIT_DATE}" \
|
|
|
|
--form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
|
|
|
|
${PUBLISH_URL}
|
|
|
|
fi
|
|
|
|
|
2015-04-01 08:23:33 -07:00
|
|
|
elif [ $PUBLISHMETA ] ; then
|
|
|
|
if [ $PUBLISH_URL ] ; then
|
|
|
|
RECENT_COMMITS=$(git shortlog -n25)
|
2015-04-02 04:08:52 -07:00
|
|
|
curl -k \
|
2015-04-01 08:23:33 -07:00
|
|
|
--form "recent_commits=${RECENT_COMMITS}" \
|
|
|
|
--form "revision=${REVISION}" \
|
|
|
|
--form "branch=${BRANCH}" \
|
|
|
|
--form "last_commit_date=${LAST_COMMIT_DATE}" \
|
|
|
|
--form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
|
|
|
|
${PUBLISH_URL}
|
|
|
|
fi
|
2015-04-03 07:02:12 -07:00
|
|
|
|
2015-01-23 16:39:26 -08:00
|
|
|
else
|
2015-03-31 09:49:07 -07:00
|
|
|
if [ $PUBLISH_URL ] ; then
|
2015-04-01 08:23:33 -07:00
|
|
|
make -j2
|
2015-04-01 07:00:42 -07:00
|
|
|
if [ -f ${TARGET_FILE}.bin ] ; then
|
2015-04-03 07:02:12 -07:00
|
|
|
TARGET_FILE=${TARGET_FILE}.bin
|
2015-04-01 07:00:42 -07:00
|
|
|
elif [ -f ${TARGET_FILE}.hex ] ; then
|
2015-04-03 07:02:12 -07:00
|
|
|
TARGET_FILE=${TARGET_FILE}.hex
|
2015-03-31 09:49:07 -07:00
|
|
|
else
|
|
|
|
echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting";
|
|
|
|
exit 1
|
2015-04-01 07:00:42 -07:00
|
|
|
fi
|
2015-03-31 09:49:07 -07:00
|
|
|
|
2015-04-02 04:08:52 -07:00
|
|
|
curl -k \
|
2015-03-31 15:23:30 -07:00
|
|
|
--form "file=@${TARGET_FILE}" \
|
|
|
|
--form "revision=${REVISION}" \
|
|
|
|
--form "branch=${BRANCH}" \
|
2015-04-01 07:00:42 -07:00
|
|
|
--form "last_commit_date=${LAST_COMMIT_DATE}" \
|
2015-04-02 04:08:52 -07:00
|
|
|
--form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \
|
2015-04-01 07:00:42 -07:00
|
|
|
${PUBLISH_URL}
|
2015-03-31 09:49:07 -07:00
|
|
|
else
|
|
|
|
make -j2
|
|
|
|
fi
|
2015-01-23 16:39:26 -08:00
|
|
|
fi
|
2015-04-03 09:00:44 -07:00
|
|
|
|