The following system dependencies must be installed to work on this project in your local development environment:
NOTE: You may need additional system binaries to be able to proceed with installing any of the above. See https://gorails.com/setup and select your operating system to learn more.
Clone this project and change to it. Then attach to the Heroku application.
git clone -o github git@github.com:Threespot/nara-ugfa.git
cd nara-ugfa
Now install the Ruby and Node.js dependencies:
bundle install
yarn install
Create a Postgres Database and run the database migrations:
createdb nara_ugfa_dev
bundle exec rails db:migrate
This codebase does not contain any credentials. Instead, developers store configuration in the environment. Locally, you store credentials in a special .env
file in the project folder.
✋ IMPORTANT: Always store configuration in the environment. Never commit code that contains credentials. If you commit code with credentials in it, those credentials are no longer safe to use and must be replaced.
Make your environment file:
touch .env
open .env
Copy the contents of the env.example
file
The file is in key-value format, with one key per line. When you boot the Rails server, it will look for this file and set the specified environment variables. Each variable is described below.
Any password, key, or username needed for your app to connect to external services. Make the key names match their associated documentation and don't be afraid to make them long.
If your dependencies are installed and the environment is A-OK, you should be able to start the Rails server and Webpack dev server with:
yarn start
This application is hosted on an AWS EC2 instance provisioned by NARA (bia.test.drupalme.net) and is available publicly at http://record.test.drupalme.net.
The deployment script is owned by the account on the above server created by NARA for use by Threespot (dboggs). In order to deploy updates to this environment you must have an appropriate SSH public key added to this account's ~/.ssh/authorized_keys
file. Once this is configured a collaborator may deploy the application by running:
ssh dboggs@34.197.152.218 -p 122 './sites/ugfa/deploy.sh'
This script will pull the latest code down from the master
branch on GitHub, install any missing dependencies, build the application, and promotes the production build to the web server directory at /appdata/www/nara-ugfa
using rsync
.