From 6677fd58ef4aa4a88f14afb4cf0187b0b3b3c483 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 7 Apr 2016 18:19:56 +0530 Subject: [PATCH] [fix] bench init using correct frappe branch --- .travis.yml | 2 +- ci/fix-mariadb.sh | 11 ----------- ci/my_config.h.patch | 22 ---------------------- travis/bench_init.sh | 8 ++++++++ 4 files changed, 9 insertions(+), 34 deletions(-) delete mode 100755 ci/fix-mariadb.sh delete mode 100644 ci/my_config.h.patch create mode 100755 travis/bench_init.sh diff --git a/.travis.yml b/.travis.yml index 12a73c9b85..966dfd37d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ install: - sudo bash setup_frappe.sh --skip-setup-bench --mysql-root-password travis - sudo pip install --upgrade pip - rm $TRAVIS_BUILD_DIR/.git/shallow - - cd ~/ && bench init frappe-bench --frappe-path https://github.com/frappe/frappe.git --frappe-branch develop + - bash $TRAVIS_BUILD_DIR/travis/bench_init.sh - cp -r $TRAVIS_BUILD_DIR/test_sites/test_site ~/frappe-bench/sites/ script: diff --git a/ci/fix-mariadb.sh b/ci/fix-mariadb.sh deleted file mode 100755 index 886ec5e0d0..0000000000 --- a/ci/fix-mariadb.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# stolen from http://cgit.drupalcode.org/octopus/commit/?id=db4f837 -includedir=`mysql_config --variable=pkgincludedir` -thiscwd=`pwd` -_THIS_DB_VERSION=`mysql -V 2>&1 | tr -d "\n" | cut -d" " -f6 | awk '{ print $1}' | cut -d"-" -f1 | awk '{ print $1}' | sed "s/[\,']//g"` -if [ "$_THIS_DB_VERSION" = "5.5.40" ] && [ ! -e "$includedir-$_THIS_DB_VERSION-fixed.log" ] ; then - cd $includedir - sudo patch -p1 < $thiscwd/ci/my_config.h.patch &> /dev/null - sudo touch $includedir-$_THIS_DB_VERSION-fixed.log -fi diff --git a/ci/my_config.h.patch b/ci/my_config.h.patch deleted file mode 100644 index 5247b5b39b..0000000000 --- a/ci/my_config.h.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -burp a/my_config.h b/my_config.h ---- a/my_config.h 2014-10-09 19:32:46.000000000 -0400 -+++ b/my_config.h 2014-10-09 19:35:12.000000000 -0400 -@@ -641,17 +641,4 @@ - #define SIZEOF_TIME_T 8 - /* #undef TIME_T_UNSIGNED */ - --/* -- stat structure (from ) is conditionally defined -- to have different layout and size depending on the defined macros. -- The correct macro is defined in my_config.h, which means it MUST be -- included first (or at least before - so, practically, -- before including any system headers). -- -- __GLIBC__ is defined in --*/ --#ifdef __GLIBC__ --#error MUST be included first! --#endif -- - #endif - diff --git a/travis/bench_init.sh b/travis/bench_init.sh new file mode 100755 index 0000000000..a8bb492ae9 --- /dev/null +++ b/travis/bench_init.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +cd ~/ +curl -I https://github.com/frappe/frappe/tree/$TRAVIS_BRANCH | head -n 1 | cut -d $' ' -f2 | ( + read response; + [ $response == '200' ] && branch=$TRAVIS_BRANCH || branch='develop'; + bench init frappe-bench --frappe-path https://github.com/frappe/frappe.git --frappe-branch $branch +)