University of Wisconsin Vegetable Disease & Insect Forecasting Network
Ruby
# install rbenv
sudo apt -y install rbenv
# install ruby-build
mkdir -p "$(rbenv root)"/plugins
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
# or update ruby-build if already installed
git -C "$(rbenv root)"/plugins/ruby-build pull
# may need to force git to use https
# per https://stackoverflow.com/questions/70663523/the-unauthenticated-git-protocol-on-port-9418-is-no-longer-supported
git config --global url."https://github.com/".insteadOf git://github.com/
# install ruby with rbenv
rbenv install 3.3.5 # or latest version
# update bundler to latest
gem install bundler
# install gems
bundle install
# or update gems
bundle update
Postgres
and gem pg
# install postgres
sudo apt -y install postgresql-14 postgresql-client-14 libpq-dev
sudo service postgresql start
# install gem pg
gem install pg
# Set postgres user password to 'password'
sudo su - postgres
psql -c "alter user postgres with password 'password'"
exit
node
and pnpm
# install npm
sudo apt install npm
npm -v
# install n, Node's version manager
sudo npm install -g n
# install the latest stable version of Node
sudo n stable
node -v
# install pnpm
curl -fsSL https://get.pnpm.io/install.sh | sh -
pnpm -v
# install packages
pnpm install
# or update packages to latest - be sure to test compatibility after updates
pnpm up --latest
- Install core dependencies listed above.
- Install ruby gems with
bundle install
and node packages withpnpm install
- Setup database with
bundle exec rails db:setup
- Run ag-weather server on port 8080 with
ag-weather> bundle exec rails s
- Run ag-vdifn server with
bin/dev
- Launch site by visiting
localhost:3000
in browser
# check ruby code for style
bundle exec standardrb --fix
bundle exec rspec
pnpm test
pnpm build
Work with db admin to authorize your ssh key for the deploy user. Confirm you can access the dev and production servers:
ssh deploy@dev.agweather.cals.wisc.edu -p 216
ssh deploy@agweather.cals.wisc.edu -p 216
Then run the following commands from the main branch to deploy:
- Staging:
cap staging deploy
- Production:
cap production deploy
Deployment targets:
- Staging: https://dev.agweather.cals.wisc.edu/vdifn
- Production: https://agweather.cals.wisc.edu/vdifn