Commit 3c531816 authored by Don Gagne's avatar Don Gagne

Merge pull request #3096 from DonLakeFlyer/TravisCleanup

Improve travis.yml readability
parents fd9e128e 5d17b531
......@@ -70,46 +70,61 @@ cache:
before_install:
- cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow && git fetch --all --tags
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then mkdir -p ~/.config/QtProject/ && cp ${TRAVIS_BUILD_DIR}/test/qtlogging.ini ~/.config/QtProject/; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then mkdir -p ~/Library/Preferences/QtProject/ && cp ${TRAVIS_BUILD_DIR}/test/qtlogging.ini ~/Library/Preferences/QtProject/; fi
- if [ "${TRAVIS_OS_NAME}" = "android" ]; then wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-android-armv7-1.5.2.tar.bz2 && mkdir -p ${TRAVIS_BUILD_DIR}/gstreamer-1.0-android-armv7-1.5.2 && tar jxf gstreamer-1.0-android-armv7-1.5.2.tar.bz2 -C ${TRAVIS_BUILD_DIR}/gstreamer-1.0-android-armv7-1.5.2; fi
- cd ${TRAVIS_BUILD_DIR} && git fetch --unshallow
- git fetch --all --tags
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
mkdir -p ~/.config/QtProject/ &&
cp ${TRAVIS_BUILD_DIR}/test/qtlogging.ini ~/.config/QtProject/
;
fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
mkdir -p ~/Library/Preferences/QtProject/ &&
cp ${TRAVIS_BUILD_DIR}/test/qtlogging.ini ~/Library/Preferences/QtProject/
;
fi
- if [ "${TRAVIS_OS_NAME}" = "android" ]; then
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-android-armv7-1.5.2.tar.bz2 &&
mkdir -p ${TRAVIS_BUILD_DIR}/gstreamer-1.0-android-armv7-1.5.2 &&
tar jxf gstreamer-1.0-android-armv7-1.5.2.tar.bz2 -C ${TRAVIS_BUILD_DIR}/gstreamer-1.0-android-armv7-1.5.2
;
fi
install:
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "${CONFIG}" != "doxygen" ]]; then
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.5.1-linux.tar.bz2
&& tar jxf Qt5.5.1-linux.tar.bz2 -C /tmp
&& export PATH=/tmp/Qt/5.5/gcc_64/bin:$PATH
&& export CXX="g++-4.8"
&& export CC="gcc-4.8"
&& export DISPLAY=:99.0
&& sh -e /etc/init.d/xvfb start
;
elif [[ "${TRAVIS_OS_NAME}" = "osx" && "${SPEC}" != "ios" ]]; then
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.5.1-mac-clang.tar.bz2
&& mkdir -p ~/qt
&& tar jxf Qt5.5.1-mac-clang.tar.bz2 -C ~/qt
&& export QT_DIR=Qt5.5-mac-clang/5.5/clang_64
&& export PATH=~/qt/$QT_DIR/bin:$PATH
&& export QT_QPA_PLATFORM_PLUGIN_PATH=~/qt/$QT_DIR/plugins
&& export QML2_IMPORT_PATH=~/qt/$QT_DIR/qml
;
elif [[ "${TRAVIS_OS_NAME}" = "osx" && "${SPEC}" = "ios" ]]; then
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.5.1-ios.tar.bz2
&& mkdir -p ~/qt-ios
&& tar jxf Qt5.5.1-ios.tar.bz2 -C ~/qt-ios
&& export PATH=~/qt-ios/ios/bin:$PATH
;
elif [ "${TRAVIS_OS_NAME}" = "android" ]; then
wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin
&& chmod +x android-ndk-r10e-linux-x86_64.bin
&& ./android-ndk-r10e-linux-x86_64.bin > /dev/null
&& export PATH=`pwd`/android-ndk-r10e:$PATH
&& export ANDROID_NDK_ROOT=`pwd`/android-ndk-r10e
&& export ANDROID_SDK_ROOT=/usr/local/android-sdk
&& wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.5.1-linux.tar.bz2
&& tar jxf Qt5.5.1-linux.tar.bz2 -C /tmp
&& export PATH=/tmp/Qt/5.5/android_armv7/bin:$PATH
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.5.1-linux.tar.bz2 &&
tar jxf Qt5.5.1-linux.tar.bz2 -C /tmp &&
export PATH=/tmp/Qt/5.5/gcc_64/bin:$PATH &&
export CXX="g++-4.8" &&
export CC="gcc-4.8" &&
export DISPLAY=:99.0 &&
sh -e /etc/init.d/xvfb start
;
fi
- if [[ "${TRAVIS_OS_NAME}" = "osx" && "${SPEC}" != "ios" ]]; then
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.5.1-mac-clang.tar.bz2 &&
tar jxf Qt5.5.1-mac-clang.tar.bz2 -C /tmp &&
export QT_DIR=Qt5.5-mac-clang/5.5/clang_64 &&
export PATH=/tmp/$QT_DIR/bin:$PATH &&
export QT_QPA_PLATFORM_PLUGIN_PATH=/tmp/$QT_DIR/plugins &&
export QML2_IMPORT_PATH=/tmp/$QT_DIR/qml
;
fi
- if [[ "${TRAVIS_OS_NAME}" = "osx" && "${SPEC}" = "ios" ]]; then
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.5.1-ios.tar.bz2 &&
tar jxf Qt5.5.1-ios.tar.bz2 -C /tmp &&
export PATH=/tmp/ios/bin:$PATH
;
fi
- if [ "${TRAVIS_OS_NAME}" = "android" ]; then
wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin &&
chmod +x android-ndk-r10e-linux-x86_64.bin &&
./android-ndk-r10e-linux-x86_64.bin > /dev/null &&
export PATH=`pwd`/android-ndk-r10e:$PATH &&
export ANDROID_NDK_ROOT=`pwd`/android-ndk-r10e &&
export ANDROID_SDK_ROOT=/usr/local/android-sdk &&
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.5.1-linux.tar.bz2 &&
tar jxf Qt5.5.1-linux.tar.bz2 -C /tmp &&
export PATH=/tmp/Qt/5.5/android_armv7/bin:$PATH
;
fi
......@@ -122,26 +137,67 @@ before_script:
- ln -s /usr/bin/ccache ~/bin/gcc
- ln -s /usr/bin/ccache ~/bin/gcc-4.8
- export PATH=~/bin:$PATH
- if [[ "${TRAVIS_OS_NAME}" = "android" && "${CONFIG}" = "installer" && -z ${ANDROID_STOREPASS} ]]; then export CONFIG=release; fi
- if [[ "${CONFIG}" != "doxygen" && "${SPEC}" != "ios" ]]; then mkdir ${SHADOW_BUILD_DIR} && cd ${SHADOW_BUILD_DIR} && qmake -r ${TRAVIS_BUILD_DIR}/qgroundcontrol.pro CONFIG+=${CONFIG} CONFIG+=WarningsAsErrorsOn -spec ${SPEC}; fi
- if [ "${SPEC}" = "ios" ]; then mkdir ${SHADOW_BUILD_DIR} && cd ${SHADOW_BUILD_DIR} && qmake -r ${TRAVIS_BUILD_DIR}/qgroundcontrol.pro CONFIG+=WarningsAsErrorsOn CONFIG-=debug_and_release CONFIG+=release; fi
- if [[ "${TRAVIS_OS_NAME}" = "android" && "${CONFIG}" = "installer" && -z ${ANDROID_STOREPASS} ]]; then
export CONFIG=release
;
fi
- if [[ "${CONFIG}" != "doxygen" && "${SPEC}" != "ios" ]]; then
mkdir ${SHADOW_BUILD_DIR} &&
cd ${SHADOW_BUILD_DIR} &&
qmake -r ${TRAVIS_BUILD_DIR}/qgroundcontrol.pro CONFIG+=${CONFIG} CONFIG+=WarningsAsErrorsOn -spec ${SPEC}
;
fi
- if [ "${SPEC}" = "ios" ]; then
mkdir ${SHADOW_BUILD_DIR} &&
cd ${SHADOW_BUILD_DIR} &&
qmake -r ${TRAVIS_BUILD_DIR}/qgroundcontrol.pro CONFIG+=WarningsAsErrorsOn CONFIG-=debug_and_release CONFIG+=release
;
fi
script:
- if [ "${TRAVIS_OS_NAME}" = "android" ]; then cd ${TRAVIS_BUILD_DIR} && ./tools/update_android_version.sh; fi
- echo 'Building QGroundControl' && echo -en 'travis_fold:start:script.1\\r'
- if [[ "${CONFIG}" != "doxygen" && "${SPEC}" != "ios" ]]; then cd ${SHADOW_BUILD_DIR} && make -j4; fi
- if [ "${SPEC}" = "ios" ]; then cd ${SHADOW_BUILD_DIR} && xcodebuild -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO; fi
- if [ "${CONFIG}" = "doxygen" ]; then cd ${TRAVIS_BUILD_DIR}/src && doxygen documentation.dox; fi
- if [ "${TRAVIS_OS_NAME}" = "android" ]; then
cd ${TRAVIS_BUILD_DIR} &&
./tools/update_android_version.sh
;
fi
- echo 'Building QGroundControl'
- echo -en 'travis_fold:start:script.1\\r'
- if [[ "${CONFIG}" != "doxygen" && "${SPEC}" != "ios" ]]; then
cd ${SHADOW_BUILD_DIR} &&
make -j4 | sed 's/${TRAVIS_BUILD_DIR}/-/'
;
fi
- if [ "${SPEC}" = "ios" ]; then
cd ${SHADOW_BUILD_DIR} &&
xcodebuild -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
;
fi
- if [ "${CONFIG}" = "doxygen" ]; then
cd ${TRAVIS_BUILD_DIR}/src &&
doxygen documentation.dox
;
fi
- echo -en 'travis_fold:end:script.1\\r'
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "${CONFIG}" = "debug" ]]; then ${SHADOW_BUILD_DIR}/debug/qgroundcontrol --unittest; fi
- if [[ "${TRAVIS_OS_NAME}" = "osx" && "${CONFIG}" = "debug" ]]; then ${SHADOW_BUILD_DIR}/debug/qgroundcontrol.app/Contents/MacOS/qgroundcontrol --unittest; fi
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "${CONFIG}" = "debug" ]]; then
${SHADOW_BUILD_DIR}/debug/qgroundcontrol --unittest
;
fi
- if [[ "${TRAVIS_OS_NAME}" = "osx" && "${CONFIG}" = "debug" ]]; then
${SHADOW_BUILD_DIR}/debug/qgroundcontrol.app/Contents/MacOS/qgroundcontrol --unittest
;
fi
after_success:
- if [ "${TRAVIS_TAG}" ]; then export GOOGLE_PLAY_TRACK=production; else export GOOGLE_PLAY_TRACK=beta; fi
- if [ "${TRAVIS_TAG}" ]; then
export GOOGLE_PLAY_TRACK=production;
else
export GOOGLE_PLAY_TRACK=beta;
fi
- if [[ "${TRAVIS_OS_NAME}" = "android" && "${TRAVIS_PULL_REQUEST}" = "false" && "${TRAVIS_BRANCH}" = "master" ]]; then
pip install --user google-api-python-client PyOpenSSL
&& cd ${TRAVIS_BUILD_DIR} && openssl aes-256-cbc -K $encrypted_25db6eb7c3fd_key -iv $encrypted_25db6eb7c3fd_iv -in ${TRAVIS_BUILD_DIR}/android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc -out android/Google_Play_Android_Developer-4432a3c4f5d1.json -d
&& ${TRAVIS_BUILD_DIR}/tools/google_play_upload.py ${GOOGLE_PLAY_TRACK} org.mavlink.qgroundcontrol ${SHADOW_BUILD_DIR}/release/package/qgroundcontrol.apk
pip install --user google-api-python-client PyOpenSSL &&
cd ${TRAVIS_BUILD_DIR} &&
openssl aes-256-cbc -K $encrypted_25db6eb7c3fd_key -iv $encrypted_25db6eb7c3fd_iv -in ${TRAVIS_BUILD_DIR}/android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc -out android/Google_Play_Android_Developer-4432a3c4f5d1.json -d &&
${TRAVIS_BUILD_DIR}/tools/google_play_upload.py ${GOOGLE_PLAY_TRACK} org.mavlink.qgroundcontrol ${SHADOW_BUILD_DIR}/release/package/qgroundcontrol.apk
;
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment