- Setup
This project relies on tmux and rvm
git clone git@github.com:chocorp-net/chocorp_web.git
- Ruby version and dependencies, NodeJS
chocorp_web
uses Ruby 2.7.0, and RVM to manage depencencies. First install ruby-2.7.0
then cd into the project. RVM should handle the rest.
rvm install ruby-2.7.0
cd chocorp_web
# RVM does its stuff
which bundle # $HOME/.rvm/rubies/ruby-2.7.0/bin/bundle
bundle install
As it is a Rails 6 project, you will need to install node
and yarn
.
- Rails
- Configuration
It will need a few configuration before we actually run it. It is going to need octoprint secrets.
cp -r private_examples private
- Development
First let's setup the database.
bin/rails db:create
bin/rails db:migrate
# If it doesn't do anything:
bin/rails db:migrate:redo
# Finally we populate the db
bin/rails db:seed
Ready to go!
- Production
Generate a new secret (make sure EDITOR is set).
rm config/credentials.yml.enc
bin/rails credentials:edit
Compile the assets.
bin/rails assets:precompile
I also had to go through all steps for setting up the database, prefixed with RAILS_ENV=production
.
- Launch the app
The tmux script takes a single argument. If set, it will start the web server in development mode, if empty in production mode.
./run.sh [random] # ezpz