diff --git a/.travis.sh b/.travis.sh index 05fa0fecc..7a8b11058 100755 --- a/.travis.sh +++ b/.travis.sh @@ -9,6 +9,30 @@ TARGET_FILE=obj/cleanflight_${TARGET} if [ $RUNTESTS ] ; then cd ./src/test && make test + # 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 ruby1.9.1 ruby1.9.1-dev rubygems zlib1g-dev libssl-dev + sudo apt-get install zlib1g-dev libssl-dev wkhtmltopdf libxml2-dev libxslt-dev #ruby-rvm + # rvmsudo gem1.9.1 install gimli + + #rvmsudo rvm package install openssl + #rvmsudo rvm install 1.9.3-p551 -j 4 + #rvmsudo rvm use --default 1.9.3-p551 + 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 + elif [ $PUBLISHMETA ] ; then if [ $PUBLISH_URL ] ; then RECENT_COMMITS=$(git shortlog -n25) @@ -20,13 +44,14 @@ elif [ $PUBLISHMETA ] ; then --form "travis_build_number=${TRAVIS_BUILD_NUMBER}" \ ${PUBLISH_URL} fi + else if [ $PUBLISH_URL ] ; then make -j2 if [ -f ${TARGET_FILE}.bin ] ; then - TARGET_FILE=${TARGET_FILE}.bin + TARGET_FILE=${TARGET_FILE}.bin elif [ -f ${TARGET_FILE}.hex ] ; then - TARGET_FILE=${TARGET_FILE}.hex + TARGET_FILE=${TARGET_FILE}.hex else echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting"; exit 1 diff --git a/.travis.yml b/.travis.yml old mode 100644 new mode 100755 index 249760b8b..f43556702 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,30 @@ env: - - RUNTESTS=True - - PUBLISHMETA=True - - TARGET=CC3D - - TARGET=CC3D OPBL=yes - - TARGET=CHEBUZZF3 - - TARGET=CJMCU - - TARGET=EUSTM32F103RC - - TARGET=SPRACINGF3 - - TARGET=NAZE - - TARGET=NAZE32PRO - - TARGET=OLIMEXINO - - TARGET=PORT103R - - TARGET=SPARKY - - TARGET=STM32F3DISCOVERY - - TARGET=ALIENWIIF1 - - TARGET=ALIENWIIF3 +# - RUNTESTS=True +# - PUBLISHMETA=True + - PUBLISHDOCS=True +# - TARGET=CC3D +# - TARGET=CC3D OPBL=yes +# - TARGET=CHEBUZZF3 +# - TARGET=CJMCU +# - TARGET=EUSTM32F103RC +# - TARGET=SPRACINGF3 +# - TARGET=NAZE +# - TARGET=NAZE32PRO +# - TARGET=OLIMEXINO +# - TARGET=PORT103R +# - TARGET=SPARKY +# - TARGET=STM32F3DISCOVERY +# - TARGET=ALIENWIIF1 +# - TARGET=ALIENWIIF3 + # We use cpp for unit tests, and c for the main project. language: cpp compiler: clang -before_install: +rvm: + - 1.9.1 + +before_install: - sudo apt-get update - wget "https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q3-update/+download/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2" @@ -31,7 +36,7 @@ install: before_script: arm-none-eabi-gcc --version script: ./.travis.sh -notifications: - irc: "chat.freenode.net#cleanflight" - use_notice: true - skip_join: true +#notifications: +# irc: "chat.freenode.net#cleanflight" +# use_notice: true +# skip_join: true diff --git a/build_docs.sh b/build_docs.sh index 78ae60610..e6c4f3888 100755 --- a/build_docs.sh +++ b/build_docs.sh @@ -2,12 +2,12 @@ filename=Manual doc_files=( - 'Introduction.md' - 'Safety.md' - 'Installation.md' - 'Configuration.md' - 'Cli.md' - 'Serial.md' + 'Introduction.md' + 'Safety.md' + 'Installation.md' + 'Configuration.md' + 'Cli.md' + 'Serial.md' 'Rx.md' 'Spektrum bind.md' 'Failsafe.md' @@ -17,23 +17,23 @@ doc_files=( 'Telemetry.md' 'LedStrip.md' 'Display.md' - 'Buzzer.md' + 'Buzzer.md' 'Sonar.md' 'Profiles.md' - 'Modes.md' - 'Inflight Adjustments.md' - 'Controls.md' + 'Modes.md' + 'Inflight Adjustments.md' + 'Controls.md' 'Autotune.md' 'Blackbox.md' 'Migrating from baseflight.md' 'Boards.md' - 'Board - AlienWii32.md' - 'Board - CC3D.md' - 'Board - CJMCU.md' - 'Board - Naze32.md' - 'Board - Sparky.md' - 'Board - Olimexino.md' - 'Board - CheBuzzF3.md' + 'Board - AlienWii32.md' + 'Board - CC3D.md' + 'Board - CJMCU.md' + 'Board - Naze32.md' + 'Board - Sparky.md' + 'Board - Olimexino.md' + 'Board - ChebuzzF3.md' ) if which gimli >/dev/null; then @@ -47,7 +47,7 @@ if which gimli >/dev/null; then cat "$i" >> ${filename}.md done rm -f ${filename}.pdf - gimli -f ${filename}.md + gimli -f ${filename}.md -stylesheet override.css rm ${filename}.md popd >/dev/null else diff --git a/docs/development/Building Manual.md b/docs/development/Building Manual.md index cb9497b65..9e08f5b23 100755 --- a/docs/development/Building Manual.md +++ b/docs/development/Building Manual.md @@ -5,8 +5,8 @@ The manual PDF file is generated by concatenating relevant markdown files and by ##Requrements & Installation The PDF manual generation uses the Gimli for the conversion. It can be installed via ruby gems. On Debian based systems the installation steps are: ```bash - sudo aptitude install rubygems wkhtmltopdf libxml2-dev libxslt-dev - sudo gem1.8 install gimli + sudo apt-get install ruby1.9.1 ruby1.9.1-dev rubygems zlib1g-dev wkhtmltopdf libxml2-dev libxslt-dev + sudo sudo gem1.9.1 install gimli ``` ##Configuration @@ -17,7 +17,4 @@ doc_files=( 'Configuration.md' '...' '...' ) -``` - -##Restritions -As the conversion via Gimli will not respect embedded image's DPI settings, the diemnsions of the image will be defined by the physical resolution in pixels. As a rule of thumb one should not embedd images wider than 600px in the markdown files. \ No newline at end of file +``` \ No newline at end of file diff --git a/docs/override.css b/docs/override.css new file mode 100755 index 000000000..05a7dd6e4 --- /dev/null +++ b/docs/override.css @@ -0,0 +1,8 @@ +IMG { + max-width: 700px; +} + +/* mainly for the cli reference table */ +TABLE TR TD, TABLE TR TH { + font-size: 9px +} diff --git a/support/buildserver/upload.php b/support/buildserver/upload.php old mode 100644 new mode 100755 index 91f4699ca..9e507e91e --- a/support/buildserver/upload.php +++ b/support/buildserver/upload.php @@ -3,7 +3,9 @@ $baseDir = "/var/www/builds/"; - $myFile = $_FILES["file"]; + $firmwareFile = $_FILES["file"]; + $manualFile = $_FILES["manual"]; + $recentCommits = $_POST["recent_commits"]; $travisJobId = sanitize($_POST["travis_build_number"]); $lastCommitDate = sanitize($_POST["last_commit_date"]); @@ -13,11 +15,21 @@ $uploadDir = $baseDir . "/" . $lastCommitDate . "/"; $prefix = $uploadDir . $travisJobId . "_" . $revision; - if(!file_exists($uploadDir)) mkdir($uploadDir, 0660, true); + if(!file_exists($uploadDir)) mkdir($uploadDir, 0770, true); + + if($firmwareFile) { + $uploadfile = $prefix . "_" . (basename($firmwareFile['name'])); + if(move_uploaded_file($firmwareFile['tmp_name'], $uploadfile)) { + echo "upload succeeded.\n"; + } + else { + echo "upload failed $uploadfile\n"; + } + } - if($myFile) { - $uploadfile = $prefix . "_" . (basename($myFile['name'])); - if(move_uploaded_file($myFile['tmp_name'], $uploadfile)) { + if($manualFile) { + $uploadfile = $prefix . "_" . (basename($manualFile['name'])); + if(move_uploaded_file($manualFile['tmp_name'], $uploadfile)) { echo "upload succeeded.\n"; } else {