Skip to content

Latest commit

 

History

History
102 lines (88 loc) · 5.05 KB

native.md

File metadata and controls

102 lines (88 loc) · 5.05 KB

Native Setup

If you can run docker, use the Base Setup instructions. Reach out to the #devops slack channel if you need to use these.

Developer Setup

Vets API requires:

  • PostgreSQL
    • Including PostGIS
  • Redis
  • Ruby 2.4.5

Base Setup

To start, fetch this code:

git clone https://github.com/department-of-veterans-affairs/vets-api.git

Automated (OSX)

If you are developing on OSX, you can run the automated setup script. From the vets-api directory, run ./bin/setup-osx && source ~/.bash_profile && cd .

Alternative (OSX)

  1. Install Ruby 2.4.5
    • It is suggested that you use a Ruby version manager such as rbenv and install Ruby 2.4.5.
    • NOTE: rbenv will also provide additional installation instructions in the console output. Make sure to follow those too.
  2. Install Bundler to manage dependencies
    • gem install bundler
  3. Install Postgres and enable on startup
    • brew install postgres
    • brew services start postgres
  4. Install PostGIS
    • brew install postgis
  5. Install Redis
    • brew install redis
    • Follow post-install instructions to enable Redis on startup. Otherwise, launch it manually with brew services start redis.
  6. Install ImageMagick
    • brew install imagemagick
  7. Install Poppler
    • brew install poppler
  8. Install ClamAV
  • brew install clamav
  • Take note of the the post-install instructions To finish installation & run clamav you will need to edit the example conf files at ${conf_files_dir} (${conf_files_dir} will differ based on your homebrew location) then:
    • cd ${conf_files_dir}
    • touch clamd.sock
    • echo "LocalSocket ${conf_files_dir}" > clamd.conf
    • echo "DatabaseMirror database.clamav.net" > freshclam.conf
    • freshclam -v
  1. Install pdftk
  2. Install gem dependencies: cd vets-api; bundle install
  3. Install overcommit overcommit --install --sign
  4. Setup localhost certificates / keys:
    • Create certs directory within config: mkdir ./config/certs
    • Copy the [certificate][certificate] to ./config/certs/vetsgov-localhost.crt
    • Copy the [key][key] to ./config/certs/vetsgov-localhost.key
    • NOTE: If you don't have access to these keys, running the following commands will provide basic functionality, such as for running unit tests:
    • touch ./config/certs/vetsgov-localhost.crt
    • touch ./config/certs/vetsgov-localhost.key
  5. Create dev database: bundle exec rake db:setup
  6. Go to the file config/settings/development.yml in your local vets-api. Switch the commented out lines pertaining to the cache_dir: uncomment out line 14 (what you use for running the app via Rails), and comment out line 15 (what you use for running the app via Docker).
  7. Make sure you have the vets-api-mockdata repo locally installed

Alternative (Ubuntu 18.04 LTS)

  1. Install Postgres, PostGIS, Redis, ImageMagick, Poppler, ClamAV, etc
    • From the vets-api directory, run ./bin/install-ubuntu-packages
  2. Edit /etc/ImageMagick-6/policy.xml and remove the lines below the comment <!-- disable ghostscript format types -->
  3. Install Ruby 2.4.5
    • It is suggested that you use a Ruby version manager such as rbenv and install Ruby 2.4.5.
    • NOTE: rbenv will also provide additional installation instructions in the console output. Make sure to follow those too.
  4. Install Bundler to manage dependencies
    • gem install bundler
  5. Install gem dependencies: cd vets-api; bundle install
  6. Install overcommit overcommit --install --sign
  7. Setup localhost certificates / keys:
    • Create certs directory within config: mkdir ./config/certs
    • Copy these certificates into the certs dir.
      • NOTE: If you don't have access to these keys, running the following commands will provide basic functionality, such as for running unit tests:
      • touch ./config/certs/vetsgov-localhost.crt
      • touch ./config/certs/vetsgov-localhost.key
  8. Create dev database: bundle exec rake db:setup
  9. Go to the file config/settings/development.yml in your local vets-api. Switch the commented out lines pertaining to the cache_dir: uncomment out line 14 (what you use for running the app via Rails), and comment out line 15 (what you use for running the app via Docker).
  10. Make sure you have the vets-api-mockdata repo locally installed