-
Notifications
You must be signed in to change notification settings - Fork 3
Local Development
Install docker: https://www.docker.com/products/docker-desktop
Install homebrew: https://brew.sh/
Install the right version of ruby with rbenv (2.5.6)
brew intall rbenv
rbenv init # restart your terminal after this command
rbenv install 2.5.6
rbenv global 2.5.6 //try local in /Beehive if future steps don't work
rbenv rehash
git clone https://github.com/asuc-octo/Beehive.git
git clone https://github.com/asuc-octo/beehive-secrets
cp beehive-secrets/.env Beehive/
cp beehive-secrets/database.yml Beehive/config/
cp beehive-secrets/Dockerrun.aws.json Beehive/
#Certs
cp beehive-secrets/certs/beehive-local.berkeley.edu.crt Beehive/config/apache2/fullchain.pem
cp beehive-secrets/certs/beehive-local.berkeley.edu.key Beehive/config/apache2/privkey.pem
gem install rails
gem install bundler
brew install libpqxx
brew install postgres
cd Beehive
bundle // re-run whenever you add or remove gems from the Gemfile
You may need to further set up SSL certificates on your system.
Spotlight Search > "Keychain Access" > File > Import Items > beehive-secrets/myCA.pem
Also Import Items > beehive-secrets/beehive-local.berkeley.edu.crt
Afterwards, search beehive.berkeley.edu
and beehive-local.berkeley.edu
in Keychain Access > Double Click > When using this certificate > Always Trust
For further information, refer to the troubleshooting wiki page.
Locally this can take 1 of 2 forms.
Method 1: Spinning up the Docker container
cd Beehive
docker-compose up --build
sudo vim /etc/hosts
add “127.0.0.1 beehive-local.berkeley.edu” to the end of /etc/hosts
Method 2: Running Puma, the local app server.
cd Beehive
rails server # or rails s
The second method is sufficient most of the time, but the first one is very helpful if you would like to emulate the production environment.
git pull
git push origin [branch-name]
git remote -v // view all remote locations/repos
git branch // view branches and which one you’re on
git checkout [branch-name] // go to branch-name