From 99858242fb75c1a5afb1fda371b12b2633f688bb Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 25 Oct 2017 05:26:04 -0400 Subject: [PATCH] CI: Replace Jenkins-oriented scripts with Travis-oriented ones --- ci/calamares-coverity.sh | 44 ---------------------------------------- ci/kpmcore-coverity.sh | 30 --------------------------- ci/travis-continuous.sh | 15 ++++++++++++++ ci/travis-coverity.sh | 34 +++++++++++++++++++++++++++++++ ci/travis.sh | 19 +++++++++++++++++ 5 files changed, 68 insertions(+), 74 deletions(-) delete mode 100755 ci/calamares-coverity.sh delete mode 100755 ci/kpmcore-coverity.sh create mode 100755 ci/travis-continuous.sh create mode 100755 ci/travis-coverity.sh create mode 100755 ci/travis.sh diff --git a/ci/calamares-coverity.sh b/ci/calamares-coverity.sh deleted file mode 100755 index c7a6351c5..000000000 --- a/ci/calamares-coverity.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -# Make sure we can make git operations from the Calamares Docker+Jenkins environment. -cp ~/jenkins-master/.gitconfig ~ -cp -R ~/jenkins-master/.ssh ~ - -cd "$WORKSPACE" -git config --global http.sslVerify false - -rm -Rf "$WORKSPACE/prefix" -mkdir "$WORKSPACE/prefix" - -git clone git://anongit.kde.org/kpmcore "$WORKSPACE/kpmcore" -cd "$WORKSPACE/kpmcore" -mkdir "$WORKSPACE/kpmcore/build" -cd "$WORKSPACE/kpmcore/build" -cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr .. -nice -n 18 make -j2 -make DESTDIR="$WORKSPACE/prefix" install - -cd "$WORKSPACE" - -wget https://scan.coverity.com/download/cxx/linux64 --no-check-certificate \ - --post-data "token=ll90T04noQ4cORJx_zczKA&project=calamares%2Fcalamares" \ - -O coverity_tool.tar.gz -mkdir "$WORKSPACE/coveritytool" -tar xvf coverity_tool.tar.gz -C "$WORKSPACE/coveritytool" --strip-components 2 -export PATH="$WORKSPACE/coveritytool/bin:$PATH" - -rm -Rf "$WORKSPACE/build" -mkdir "$WORKSPACE/build" -cd "$WORKSPACE/build" - -CMAKE_PREFIX_PATH="$WORKSPACE/prefix/usr" cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr -DWEBVIEW_FORCE_WEBKIT=1 .. -nice -n 18 cov-build --dir cov-int make -j2 - -tar caf calamares-ci.tar.xz cov-int - -curl -k --form token=ll90T04noQ4cORJx_zczKA \ - --form email=teo@kde.org \ - --form file=@calamares-ci.tar.xz \ - --form version="master-`date -u +%Y%m%d`" \ - --form description="master on `date -u`" \ - https://scan.coverity.com/builds?project=calamares%2Fcalamares diff --git a/ci/kpmcore-coverity.sh b/ci/kpmcore-coverity.sh deleted file mode 100755 index 9507fc438..000000000 --- a/ci/kpmcore-coverity.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -#Hack for Coverity build, so the compiler doesn't complain about InheritanceChecker -sudo cp ~/jenkins-master/kpluginfactory.h /usr/include/KF5/KCoreAddons - -cd "$WORKSPACE" -wget https://scan.coverity.com/download/cxx/linux64 --no-check-certificate \ - --post-data "token=cyOjQZx5EOFLdhfo7ZDa4Q&project=KDE+Partition+Manager+Core+Library+-+KPMcore" \ - -O coverity_tool.tar.gz -mkdir "$WORKSPACE/coveritytool" -tar xvf coverity_tool.tar.gz -C "$WORKSPACE/coveritytool" --strip-components 2 -export PATH="$WORKSPACE/coveritytool/bin:$PATH" - -rm -Rf "$WORKSPACE/build" -mkdir "$WORKSPACE/build" -cd "$WORKSPACE/build" - -cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr .. -nice -n 18 cov-build --dir cov-int make -j2 - -tar cavf kpmcore-ci.tar.xz cov-int - -cat cov-int/build-log.txt - -curl -k --form token=cyOjQZx5EOFLdhfo7ZDa4Q \ - --form email=teo@kde.org \ - --form file=@kpmcore-ci.tar.xz \ - --form version="master-`date -u +%Y%m%d`" \ - --form description="master on `date -u`" \ - https://scan.coverity.com/builds?project=KDE+Partition+Manager+Core+Library+-+KPMcore diff --git a/ci/travis-continuous.sh b/ci/travis-continuous.sh new file mode 100755 index 000000000..02994be74 --- /dev/null +++ b/ci/travis-continuous.sh @@ -0,0 +1,15 @@ +#! /bin/sh +# +# Travis CI script for use on every-commit: +# - build and install Calamares +# +test -n "$BUILDDIR" || exit 1 +test -n "$SRCDIR" || exit 1 + +test -d $BUILDDIR || exit 1 +test -d $SRCDIR || exit 1 +test -f $SRCDIR/CMakeLists.txt || exit 1 + +cd $BUILDDIR || exit 1 + +cmake -DWEBVIEW_FORCE_WEBKIT=1 -DKDE_INSTALL_USE_QT_SYS_PATHS=ON $SRCDIR && make -j2 && make install DESTDIR=/build/INSTALL_ROOT diff --git a/ci/travis-coverity.sh b/ci/travis-coverity.sh new file mode 100755 index 000000000..07da4ce1a --- /dev/null +++ b/ci/travis-coverity.sh @@ -0,0 +1,34 @@ +#! /bin/sh +# +# Travis CI script for weekly (cron) use: +# - use the coverity tool to build and and upload results +# +test -n "$COVERITY_SCAN_TOKEN" || exit 1 +test -n "$BUILDDIR" || exit 1 +test -n "$SRCDIR" || exit 1 + +test -d $BUILDDIR || exit 1 +test -d $SRCDIR || exit 1 +test -f $SRCDIR/CMakeLists.txt || exit 1 + +cd $BUILDDIR || exit 1 + +curl -k -o coverity_tool.tar.gz \ + -d "token=$COVERITY_SCAN_TOKEN&project=calamares%2Fcalamares" \ + https://scan.coverity.com/download/cxx/linux64 || exit 1 +mkdir "$BUILDDIR/coveritytool" +tar xvf coverity_tool.tar.gz -C "$BUILDDIR/coveritytool" --strip-components 2 +export PATH="$BUILDDIR/coveritytool/bin:$PATH" + + +cmake -DCMAKE_BUILD_TYPE=Debug -DWEBVIEW_FORCE_WEBKIT=1 -DKDE_INSTALL_USE_QT_SYS_PATHS=ON $SRCDIR || exit 1 +cov-build --dir cov-int make -j2 + +tar caf calamares-ci.tar.xz cov-int + +curl -k --form token=$COVERITY_SCAN_TOKEN \ + --form email=groot@kde.org \ + --form file=@calamares-ci.tar.xz \ + --form version="master-`date -u +%Y%m%d`" \ + --form description="master on `date -u`" \ + https://scan.coverity.com/builds?project=calamares%2Fcalamares diff --git a/ci/travis.sh b/ci/travis.sh new file mode 100755 index 000000000..c8ac49f5d --- /dev/null +++ b/ci/travis.sh @@ -0,0 +1,19 @@ +#! /bin/sh +# +# Travis build driver script: +# - the regular CI runs, triggered by commits, run a script that builds +# and installs calamares, and then runs the tests. +# - the cronjob CI runs, triggered weekly, run a script that uses the +# coverity tools to submit a build. This is slightly more resource- +# intensive than the coverity add-on, but works on master. +# +D=`dirname "$0"` +test -d "$D" || exit 1 +test -x "$D/travis-continuous.sh" || exit 1 +test -x "$D/travis-coverity.sh" || exit 1 + +if test "$TRAVIS_EVENT_TYPE" = "cron" ; then + exec "$D/travis-coverity.sh" +else + exec "$D/travis-continuous.sh" +fi