The administration system for Schönherz Zoltán Student Hostel and SVIE
- Ruby 2.4.2
- Postgresql 9.6
- Node (asset compiling)
- Redis (optional)
or
- Docker
# Redis is optional
sudo apt install postgresql-9.6 libpq-dev nodejs redis-server
Use asdf with ruby plugin or rbenv. Install Ruby 2.4.2 and set executable version. You can check current ruby version with ruby -v
Easiest way to install brew, then install required packages.
# Redis is optional
brew install asdf [email protected] redis
brew services start [email protected]
brew services start redis
Add ruby and node plugin to asdf. Install Ruby 2.4.2 and set executable version. You can check current ruby version with ruby -v
. Install node too.
git clone https://github.com/kir-dev/pek-next.git
cd pek-next
gem install bundler
bundle install
Create a .env
file using .env.example
and replace the values with real ones.
sudo su postgres
psql -c 'create user "pek-next" with superuser password '\''pek-next'\'';'
As your own user
rake db:setup
rails s
bundle exec sidekiq
rake test
Easiest way for deployment is docker-compose.
Copy .env
from .env.example
, add APP_ID
and APP_SECRET
according to auth.sch and generate a SECRET_KEY_BASE
using bundle exec rake secret
.
Then run the following commands:
# These volumes are not necessary and could be removed from docker-compose, but a named volume easier to find later on
docker volume create pek_public
docker volume create pek_database
docker-compose up --build
After creating, while the containers are running run the following commands:
# This is only necessary at new setups
docker-compose run web bash -c "bundle exec rake db:setup"
# This is only necessary after pending migrations
docker-compose run web bash -c "bundle exec rake db:migrate"
# This is required at new setups and after changing in assets
docker-compose run web bash -c "bundle exec rake assets:precompile"
sudo apt install ruby-dev
rbenv install -v 2.4.2
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
Restart your terminal
by Kir-Dev Team