2014-06-28 02:08:57 +08:00
|
|
|
#!/bin/bash -x
|
2014-06-27 19:19:58 +08:00
|
|
|
|
|
|
|
set -e
|
|
|
|
set -o pipefail
|
2014-06-28 02:08:57 +08:00
|
|
|
set -x
|
2014-06-27 19:19:58 +08:00
|
|
|
|
|
|
|
with_timestamps() {
|
|
|
|
while read -r line; do
|
|
|
|
echo -e "$(date +%T)\t$line";
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bootstrap_zm() {
|
|
|
|
|
|
|
|
if [ "$ZM_BUILDMETHOD" = "autotools" ]; then libtoolize --force; fi
|
|
|
|
if [ "$ZM_BUILDMETHOD" = "autotools" ]; then aclocal; fi
|
|
|
|
if [ "$ZM_BUILDMETHOD" = "autotools" ]; then autoheader; fi
|
|
|
|
if [ "$ZM_BUILDMETHOD" = "autotools" ]; then automake --force-missing --add-missing; fi
|
|
|
|
if [ "$ZM_BUILDMETHOD" = "autotools" ]; then autoconf; fi
|
|
|
|
|
|
|
|
mysql -uroot -e "CREATE DATABASE IF NOT EXISTS zm"
|
|
|
|
mysql -uroot -e "GRANT ALL ON zm.* TO 'zmuser'@'localhost' IDENTIFIED BY 'zmpass'";
|
|
|
|
mysql -uroot -e "FLUSH PRIVILEGES"
|
2014-06-28 02:13:29 +08:00
|
|
|
mysql -uzmuser -pzmpass < ${TRAVIS_BUILD_DIR}/db/zm_create.sql
|
2014-06-27 19:19:58 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
bootstrap_zm | with_timestamps
|