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-serverUse 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 postgresql@9.6 redis
brew services start postgresql@9.6
brew services start redisAdd 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 installCreate 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:setuprails sbundle exec sidekiqrake testEasiest 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 --buildAfter 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-devrbenv install -v 2.4.2echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrcRestart your terminal
by Kir-Dev Team



