Skip to content

Commit 127f356

Browse files
committed
Merge pull request ggtracker#3 from gravelweb/auto-install
Provisioning scripts for vagrant
2 parents 1238aeb + 37fe0fb commit 127f356

File tree

4 files changed

+60
-8
lines changed

4 files changed

+60
-8
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ Project to run the whole ggtracker stack in vagrant
33

44
### Running
55
* Make sure you have vagrant+virtualbox installed on your computer
6-
* Run `vagrant up` to create the virtual box
6+
* Run `git submodule update --init` to pull submodules
7+
* Run `vagrant up` to create the virtual box. This will download all required packages and go through the installation process for ggtracker and ESDB (~15 minutes; go make yourself a sandwich)
78
* Run `vagrant ssh` to ssh into the vagrant box
8-
* Find code in /vagrant
9-
* Run the installation and updating steps of the components (ESDB and ggtracker) ([will be automated soon](https://github.com/gravelweb/ggtrackerstack/commit/e3bdbb30d9384d37e8b96692af81cefd5f8a87d2))
10-
* ESDB: https://github.com/dsjoerg/esdb#installation-and-setup
11-
* ggtracker: https://github.com/dsjoerg/ggtracker#basic-installation-and-updating
12-
* Note: You need to run ggtracker webapp like this `ESDB_HOST=172.28.128.3:9292 foreman start` (change ip accordingly)
9+
* Find code in /vagrant `cd /vagrant`
10+
* Start the application (requires 2 ssh sessions, or run them as background jobs)
11+
* ESDB: `(cd esdb && foreman start)`
12+
* ggtracker: `(cd ggtracker && ESDB_HOST=172.28.128.3:9292 foreman start)` (change IP accordingly)
1313
* Set up Amazon AWS S3 buckets for development as described in [esdb/config/s3.yml.example](https://github.com/dsjoerg/esdb/blob/master/config/s3.yml.example) (only dev and test are needed) and set up buckets and credentials accordingly in `esdb/config/s3.yml`.
1414
* Set up a hostname for the vagrant box's ip in /etc/hosts - e.g. `172.28.128.3 ggtracker.test` (change ip accordingly)
1515
* The app will be on `ggtracker.test` in the browser and uploading should work - otherwise please raise an issue here, so it can be fixed.

Vagrantfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Vagrant.configure("2") do |config|
44
config.vm.hostname = "ggtrackerstack"
55

66
config.vm.provision "shell", path: "setup-vagrantbox.sh"
7+
config.vm.provision "shell", path: "install-ggtrackerstack.sh", privileged: false
78

89
config.vm.provider :virtualbox do |vb|
910
vb.memory = 1536

install-ggtrackerstack.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
cd /vagrant
6+
7+
8+
echo INSTALLING GGTRACKER
9+
# install ggtracker
10+
(cd ggtracker && \
11+
bundle && \
12+
cp -np config/secrets.yml{.example,} && \
13+
cp -np config/s3.yml{.example,} && \
14+
rake db:create && \
15+
bundle exec rake db:schema:load)
16+
17+
echo INSTALLING ESDB
18+
(cd esdb && \
19+
cp -np config/database.yml{.example,} && \
20+
bundle && \
21+
(mysql -u root <<-"EOF"
22+
create database if not exists esdb_development;
23+
create database if not exists esdb_test;
24+
EOF
25+
) && \
26+
cp -np config/s3.yml{.example,} && \
27+
cp -np config/fog.rb{.example,} && \
28+
cp -np config/redis.yml{.example,} && \
29+
cp -np config/esdb.yml{.example,} && \
30+
cp -np config/tokens.yml{.example,} && \
31+
bundle exec sequel -m db/migrations -e development config/database.yml && \
32+
cat db/replays_sq_skill_stat.sql | mysql -u root -D esdb_development && \
33+
cat db/ggtracker_provider.sql | mysql -u root -D esdb_development && \
34+
bundle exec rake py:init && \
35+
bundle exec sequel -m db/migrations -e test config/database.yml && \
36+
echo RUNNING TESTS && \
37+
bundle exec rspec)
38+
39+
echo DONE install-ggtrackerstack.sh

setup-vagrantbox.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
#!/bin/bash
22

3+
set -e
4+
35
export DEBIAN_FRONTEND=noninteractive
46

57
add-apt-repository ppa:chris-lea/redis-server -y
68

79
apt-get update
810

9-
apt-get install -y ruby redis-server nodejs npm mysql-server git-core ruby-dev libcurl4-openssl-dev libmysqlclient-dev build-essential libxml2-dev libxslt-dev memcached imagemagick libsasl2-dev python-pip python-dev libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk
11+
# GGTRACKER dependencies
12+
apt-get install -y \
13+
ruby redis-server nodejs npm mysql-server git-core ruby-dev \
14+
libcurl4-openssl-dev libmysqlclient-dev build-essential libxml2-dev \
15+
libxslt-dev
16+
17+
# ESDB dependencies
18+
apt-get install -y \
19+
memcached imagemagick libsasl2-dev python-pip python-dev libtiff5-dev \
20+
libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev \
21+
tk8.6-dev python-tk
1022

1123
gem install bundler
1224
npm install -g juggernaut
1325

14-
# Juggetnaut looks for `node` instead of `nodejs`
26+
# Juggernaut looks for `node` instead of `nodejs`
1527
sudo ln -s /usr/bin/nodejs /usr/bin/node

0 commit comments

Comments
 (0)