forked from CDL-Dryad/dryad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis-prep.sh
executable file
·56 lines (38 loc) · 1.23 KB
/
travis-prep.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
# ############################################################
# Setup
# Make sure we know where we are
PROJECT_ROOT=`pwd`
GITHUB_USER=`git config --get remote.origin.url | sed 's/https:\/\/github\.com\///' | sed 's/\/.*$//'`
# Fail fast
set -e
# ############################################################
# Local dependencies
if [ ! -d ../stash ]; then
BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
echo "Cloning https://github.com/$GITHUB_USER/stash:"
cd ..
set -x
git clone https://github.com/$GITHUB_USER/stash
cd stash
if git checkout ${BRANCH}; then
echo "Checking out stash branch ${BRANCH}"
else
echo "No branch ${BRANCH}, checking out master"
git checkout master
fi
{ set +x; } 2>/dev/null
SE_REVISION=$(git rev-parse HEAD)
echo "Checked out stash revision ${SE_REVISION}"
cd ${PROJECT_ROOT}
fi
# ############################################################
# Test database
echo "Initializing database:"
set -x
mysql -u root -e 'CREATE DATABASE IF NOT EXISTS dashv2_test'
mysql -u root -e 'GRANT ALL ON dashv2_test.* TO travis@localhost'
{ set +x; } 2>/dev/null
# ############################################################
# Configuration
bash symlink_config.sh