nossas / bonde-server

API Rails
GNU General Public License v3.0
8 stars 5 forks source link
api mailchimp pagarme rails sendgrid

CircleCI Codacy Badge Codacy Badge

Enviroment

# Install Rbenv
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc

# Install dependencies
apt-get install -y libssl-dev libreadline-dev build-essential zlib1g-dev
rbenv install 2.4.6

# Enter local folder, ex: cd nossas/bonde-server/
rbenv local 2.4.6
sudo apt-get install libpq-dev imagemagick libmagickwand-dev
rbenv exec gem install bundler -v 1.17.3

Install

rbenv exec bundle
rbenv exec rake db:create db:migrate db:seed
rbenv exec bundle exec puma -C config/puma.rb

And the server is on fire :fire:

Tests

DATABASE_URL=postgres://monkey_user:monkey_pass@10.0.0.12:5432/bonde_test bundle exec rspec spec

Docker Commands

docker-compose exec pgmaster psql -Umonkey_user postgres -c "create database bonde_test"
docker-compose exec api-v1 bundle exec rake db:migrate DATABASE_URL=postgres://monkey_user:monkey_pass@10.0.0.12:5432/bonde_test RAILS_ENV=test 

And the green lights start to pop up :green_heart: