/
test-integration-gocli.sh
executable file
·59 lines (45 loc) · 1.27 KB
/
test-integration-gocli.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
57
58
59
#!/usr/bin/env bash
set -e
source bosh-src/ci/tasks/utils.sh
check_param RUBY_VERSION
check_param DB
echo "Starting $DB..."
case "$DB" in
mysql)
mv /var/lib/mysql /var/lib/mysql-src
mkdir /var/lib/mysql
mount -t tmpfs -o size=512M tmpfs /var/lib/mysql
mv /var/lib/mysql-src/* /var/lib/mysql/
sudo service mysql start
;;
postgresql)
export PATH=/usr/lib/postgresql/9.4/bin:$PATH
mkdir /tmp/postgres
mount -t tmpfs -o size=512M tmpfs /tmp/postgres
mkdir /tmp/postgres/data
chown postgres:postgres /tmp/postgres/data
su postgres -c '
export PATH=/usr/lib/postgresql/9.4/bin:$PATH
export PGDATA=/tmp/postgres/data
export PGLOGS=/tmp/log/postgres
mkdir -p $PGDATA
mkdir -p $PGLOGS
initdb -U postgres -D $PGDATA
pg_ctl start -l $PGLOGS/server.log -o "-N 400"
'
;;
*)
echo "Usage: DB={mysql|postgresql} $0 {commands}"
exit 1
esac
mv ./bosh-cli/*bosh-cli-*-linux-amd64 /usr/local/bin/gobosh
chmod +x /usr/local/bin/gobosh
source /etc/profile.d/chruby.sh
chruby $RUBY_VERSION
agent_path=bosh-src/go/src/github.com/cloudfoundry/
mkdir -p $agent_path
cp -r bosh-agent $agent_path
cd bosh-src/src
print_git_state
bundle install --local
bundle exec rake --trace spec:integration_gocli