Navigation Menu

Skip to content

Commit

Permalink
travis: extract before_script
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 9, 2012
1 parent 036ea99 commit ca6a90e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 20 deletions.
22 changes: 2 additions & 20 deletions .travis.yml
Expand Up @@ -5,33 +5,15 @@ env:
- MYSQL_VERSION=system
- MYSQL_VERSION=5.5.25a
install:
- sed -e 's/^deb/deb-src/' /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/source.list
- echo "deb http://packages.groonga.org/ubuntu/ $(lsb_release --short --codename) universe" | sudo tee /etc/apt/sources.list.d/groonga.list
- sudo apt-get update
- sudo apt-get -y --allow-unauthenticated install groonga-keyring
- sudo apt-get -y purge zeromq
- sudo apt-get update
- sudo apt-get -y install libgroonga-dev
- sudo apt-get -y build-dep mysql-server
- sudo apt-get -y install cmake
before_script:
- |
if [ "$MYSQL_VERSION" = "system" ]; then
apt-get source mysql-server
ln -s $(find . -maxdepth 1 -type d | sort | tail -1) mysql
cd mysql
debuild -us -uc -Tconfigure
make -j$(grep '^processor' /proc/cpuinfo | wc -l) > /dev/null
cd ..
else
wget http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.5/mysql-${MYSQL_VERSION}.tar.gz
tar xvzf mysql-${MYSQL_VERSION}.tar.gz
ln -s mysql-${MYSQL_VERSION} mysql
cd mysql
BUILD/compile-amd64-debug-max
cd ..
fi
- ./autogen.sh
- ./configure --with-mysql-source=$PWD/mysql --with-mysql-config=$PWD/mysql_config
- tools/travis_before_script.sh
script:
- test/run-unit-test.sh
- test/run-sql-test.sh
30 changes: 30 additions & 0 deletions tools/travis_before_script.sh
@@ -0,0 +1,30 @@
#!/bin/sh

set -x
set -e

mkdir -p vendor
cd vendor
if [ "$MYSQL_VERSION" = "system" ]; then
sudo apt-get -y build-dep mysql-server
apt-get source mysql-server
ln -s $(find . -maxdepth 1 -type d | sort | tail -1) mysql
cd mysql
debuild -us -uc -Tconfigure
make -j$(grep '^processor' /proc/cpuinfo | wc -l) > /dev/null
cd ..
else
sudo apt-get -y install cmake
wget http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.5/mysql-${MYSQL_VERSION}.tar.gz
tar xvzf mysql-${MYSQL_VERSION}.tar.gz
ln -s mysql-${MYSQL_VERSION} mysql
cd mysql
BUILD/compile-amd64-debug-max
cd ..
fi
cd ..

./autogen.sh
./configure \
--with-mysql-source=$PWD/vendor/mysql \
--with-mysql-config=$PWD/vendor/mysql/mysql_config

0 comments on commit ca6a90e

Please sign in to comment.