From 17d9da40365a799011f23d6767e8a7a8d241a3da Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 24 Nov 2015 20:25:53 -0200 Subject: [PATCH] travis: use container infrastructure In order to use the container infrastructure we can't use sudo to install packages. Now Travis has a way to install packages by specifying them in the .travis.yml. This greatly simplifies how we install the packages and there's no need for a separate script anymore. This also removes several outdated packages that aren't needed anymore. --- .travis.yml | 51 ++++++++++---- Tools/scripts/build_all_travis.sh | 5 +- Tools/scripts/install-travis-env.sh | 103 ---------------------------- 3 files changed, 39 insertions(+), 120 deletions(-) delete mode 100755 Tools/scripts/install-travis-env.sh diff --git a/.travis.yml b/.travis.yml index cfa903f5ef..7ab67b226b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,45 @@ language: cpp -sudo: required +sudo: false + +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - build-essential + - g++-4.8 + - gcc-4.8 + - genromfs + - libc6-i386 + - python-argparse + - python-empy + - python-serial + - zlib1g-dev + coverity_scan: + project: + name: "diydrones/ardupilot" + description: "Build submitted via Travis CI" + notification_email: andrew-scan@tridgell.net + build_command_prepend: "make clean" + build_command: "make" + branch_pattern: coverity_scan before_install: - - APMDIR=$(pwd) && pushd .. && $APMDIR/Tools/scripts/install-travis-env.sh -y && . ~/.profile && popd + - pushd . + && cd ~ + && wget http://firmware.diydrones.com/Tools/PX4-tools/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 + && tar -xf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 + && wget http://firmware.diydrones.com/Tools/Travis/NavIO/master.tar.gz + && tar -xf master.tar.gz + && mkdir -p $HOME/bin + && ln -sf /usr/bin/gcc-4.8 $HOME/bin/gcc + && ln -sf /usr/bin/g++-4.8 $HOME/bin/g++ + && exportline="export PATH=$HOME/bin:$HOME/gcc-arm-none-eabi-4_9-2015q3/bin:$HOME/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:\$PATH" + && if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi + && . ~/.profile + && popd -script: +script: - Tools/scripts/build_all_travis.sh notifications: @@ -23,13 +58,3 @@ env: matrix: - TRAVIS_BUILD_TARGET="px4-v2" - TRAVIS_BUILD_TARGET="sitl linux navio raspilot minlure" - -addons: - coverity_scan: - project: - name: "diydrones/ardupilot" - description: "Build submitted via Travis CI" - notification_email: andrew-scan@tridgell.net - build_command_prepend: "make clean" - build_command: "make" - branch_pattern: coverity_scan diff --git a/Tools/scripts/build_all_travis.sh b/Tools/scripts/build_all_travis.sh index de22e57fa3..754954646b 100755 --- a/Tools/scripts/build_all_travis.sh +++ b/Tools/scripts/build_all_travis.sh @@ -3,10 +3,7 @@ # This helps when doing large merges # Andrew Tridgell, November 2011 -. config.mk - -set -e -set -x +set -ex . ~/.profile diff --git a/Tools/scripts/install-travis-env.sh b/Tools/scripts/install-travis-env.sh deleted file mode 100755 index 9b29fb2afb..0000000000 --- a/Tools/scripts/install-travis-env.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/bash -# install dependencies for travis build testing - -set -e -set -v - -CWD=$(pwd) -OPT="$HOME/opt" -echo "PATH=$PATH" - -BASE_PKGS="gawk make git arduino-core curl" -SITL_PKGS="g++ python-pip python-matplotlib python-serial python-wxgtk2.8 python-scipy python-opencv python-numpy python-pyparsing ccache python-empy" -PYTHON_PKGS="pymavlink MAVProxy catkin_pkg" -PX4_PKGS="python-serial python-argparse openocd flex bison libncurses5-dev \ - autoconf texinfo build-essential libftdi-dev libtool zlib1g-dev \ - zip genromfs" -UBUNTU64_PKGS="libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 gcc-multilib" - -# GNU Tools for ARM Embedded Processors -# (see https://launchpad.net/gcc-arm-embedded/) -ARM_ROOT="gcc-arm-none-eabi-4_9-2015q3" -ARM_TARBALL="$ARM_ROOT-20150921-linux.tar.bz2" -ARM_TARBALL_URL="http://firmware.diydrones.com/Tools/PX4-tools/$ARM_TARBALL" - -RPI_ROOT="master" -RPI_TARBALL="$RPI_ROOT.tar.gz" -RPI_TARBALL_URL="http://firmware.diydrones.com/Tools/Travis/NavIO/$RPI_TARBALL" - -# Ardupilot Tools -ARDUPILOT_TOOLS="ardupilot/Tools/autotest" - -APT_GET="sudo apt-get -qq --assume-yes" - -$APT_GET update -$APT_GET install $BASE_PKGS $SITL_PKGS $PX4_PKGS $UBUNTU64_PKGS -sudo pip install --upgrade pip || { - echo "pip upgrade failed" -} -sudo pip install --upgrade setuptools || { - echo "setuptools upgrade failed" -} -for pkg in $PYTHON_PKGS; do - echo "Installing $pkg" - sudo pip -q install $pkg || echo "FAILED INSTALL OF $pkg" -done - -# install some extra packages (for later AVR compiler) -rsync -av firmware.diydrones.com::Tools/Travis/*.deb ExtraPackages -sudo dpkg -i ExtraPackages/*.deb || echo "FAILED INSTALL OF EXTRA DEBS" - -# try to upgrade to g++ 4.8. See https://github.com/travis-ci/travis-ci/issues/1379 -(sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && -sudo apt-get -qq update && -sudo apt-get -qq install g++-4.8 && -sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90) || { - echo "upgrade to gcc 4.8 failed" -} - - -if [ ! -d PX4Firmware ]; then - git clone https://github.com/diydrones/PX4Firmware.git -fi - -if [ ! -d PX4NuttX ]; then - git clone https://github.com/diydrones/PX4NuttX.git -fi - -if [ ! -d uavcan ]; then - git clone https://github.com/diydrones/uavcan.git -fi - -if [ ! -d VRNuttX ]; then - git clone https://github.com/virtualrobotix/vrbrain_nuttx.git VRNuttX -fi - -mkdir -p $OPT - -cd $OPT -wget $ARM_TARBALL_URL -tar xjf ${ARM_TARBALL} -rm -f ${ARM_TARBALL} - -cd $OPT -wget $RPI_TARBALL_URL -tar xzf ${RPI_TARBALL} -rm -f ${RPI_TARBALL} - -exportline="export PATH=$OPT/$ARM_ROOT/bin:\$PATH"; -echo $exportline >> ~/.profile - -exportline2="export PATH=$CWD/$ARDUPILOT_TOOLS:\$PATH"; -echo $exportline2 >> ~/.profile - -exportline3="export PATH=$OPT/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:\$PATH"; -echo $exportline3 >> ~/.profile - -. ~/.profile -echo $PATH -ls -l $OPT/$ARM_ROOT/bin -$OPT/$ARM_ROOT/bin/arm-none-eabi-gcc --version - -echo "Compiler for NavIO" -arm-linux-gnueabihf-gcc --version