Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Initial whack at uber install script
  • Loading branch information
gravelweb committed Apr 16, 2016
commit 4d4d13d3b1812178822c5f1f45e215b683d3c1c4
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Project to run the whole ggtracker stack in vagrant

### Running
* Make sure you have vagrant+virtualbox installed on your computer
* Run `vagrant up` to create the virtual box
* Run `git submodule update --init` to pull submodules
* 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)
* Run `vagrant ssh` to ssh into the vagrant box
* Find code in /vagrant
* Run the installation and updating steps of the components (ESDB and ggtracker) ([will be automated soon](https://github.com/gravelweb/ggtrackerstack/commit/e3bdbb30d9384d37e8b96692af81cefd5f8a87d2))
* ESDB: https://github.com/dsjoerg/esdb#installation-and-setup
* ggtracker: https://github.com/dsjoerg/ggtracker#basic-installation-and-updating
* Note: You need to run ggtracker webapp like this `ESDB_HOST=172.28.128.3:9292 foreman start` (change ip accordingly)
* Find code in /vagrant `cd /vagrant`
* Start the application (requires 2 ssh sessions, or run them as background jobs)
* ESDB: `(cd esdb && foreman start)`
* ggtracker: `(cd ggtracker && ESDB_HOST=172.28.128.3:9292 foreman start)` (change IP accordingly)
* 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`.
* Set up a hostname for the vagrant box's ip in /etc/hosts - e.g. `172.28.128.3 ggtracker.test` (change ip accordingly)
* 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.
1 change: 1 addition & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Vagrant.configure("2") do |config|
config.vm.hostname = "ggtrackerstack"

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

config.vm.provider :virtualbox do |vb|
vb.memory = 1536
Expand Down
39 changes: 39 additions & 0 deletions install-ggtrackerstack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

set -e

cd /vagrant


echo INSTALLING GGTRACKER
# install ggtracker
(cd ggtracker && \
bundle && \
cp -np config/secrets.yml{.example,} && \
cp -np config/s3.yml{.example,} && \
rake db:create && \
bundle exec rake db:schema:load)

echo INSTALLING ESDB
(cd esdb && \
cp -np config/database.yml{.example,} && \
bundle && \
(mysql -u root <<-"EOF"
create database if not exists esdb_development;
create database if not exists esdb_test;
EOF
) && \
cp -np config/s3.yml{.example,} && \
cp -np config/fog.rb{.example,} && \
cp -np config/redis.yml{.example,} && \
cp -np config/esdb.yml{.example,} && \
cp -np config/tokens.yml{.example,} && \
bundle exec sequel -m db/migrations -e development config/database.yml && \
cat db/replays_sq_skill_stat.sql | mysql -u root -D esdb_development && \
cat db/ggtracker_provider.sql | mysql -u root -D esdb_development && \
bundle exec rake py:init && \
bundle exec sequel -m db/migrations -e test config/database.yml && \
echo RUNNING TESTS && \
bundle exec rspec)

echo DONE install-ggtrackerstack.sh