Skip to content

Development resources

Marilia TW edited this page Jul 29, 2024 · 1 revision

Access Accounts

Github personal github account

CircleCi connect to github

Heroku and Heroku Data noipm.infrastructure@gmail.com

Dockerhub noipminfrastructure login

Auth0 Admin Dashboard whichever method you choose after accepting invitation

AWS Console noipm.infrastructure@gmail.com

Google Cloud Console noipm.infrastructure@gmail.com

Okta non-prod Admin Page

Okta Hawaii Prod Admin Page

Local Environment

Q: Which environment variables will I need?

A: Local machine environment (.bashrc, .zshrc, etc):

REACT_APP_GOOGLE_API_KEY: Obtained from a core team member, this key should be located in your .profile, .zshrc, or comparable local machine environment. It allows you to access address data from Google Maps.

TEST_USER: Used for e2e testing, this should be set to your personal, local Auth0 account username is. Likely your ThoughtWorks email. For access to Auth0 credentials, please ask for an invite from the core team.

TEST_PASS: The password for the TEST_USER Auth0 account.

awsConfig.json: See the README for NOIPM repo: https://github.com/PublicDataWorks/police_data_manager#set-up-local-configuration-for-aws-s3

Q: I want to point to AWS S3 and other services for local testing, how can I do that?

A: You will need to adjust the following environment variables:

You must change USE_CLOUD_SERVICES and REACT_APP_USE_CLOUD_SERVICES from false to true in docker-compose.yml

You will need to setup AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in your environment variables so PDM can connect to the AWS

You can get the AWS credentials from 1Password, they are stored under the aws:noipm-local key

Inserting CI Data into Your Local Environment Q: I want to use CI data in my local environment. How do I do that?

A: You will need access to data.heroku and NOIPM's Heroku credentials to retrieve the data. Once you are logged in, select CI database. Under the "Durability" tab at left, click the "Create Manual Backup", which appears on the bottom right side. Once the file has finished being created, click "Download". Once the file (a .dump) file has finished downloading to your Downloads folder, find its name (it should be a long string of characters). In terminal, type pg_restore -h localhost -p 5432 -U postgres -1 ~/Downloads/backup_file_name_here.dump, replacing "backup_file_name_here.dump" with the name of your backup file. Hit enter and watch the data transfer!

If you have DBeaver installed and connections for CI setup there: Follow this backup/restore guide.

CircleCI Pipeline

Note: Instructions for installing CircleCI CLI can be found here

Q: How do I run e2e tests against CI with CircleCI locally?

A: Un-comment the "Install Git" step in e2e-testing-ci-pdm job (.circleci/config.yml) and run the following command:

circleci local execute -c .circleci/config.yml -e CI_TEST_PASS= -e CI_TEST_USER= --job e2e-testing-ci-pdm

Q: How do I manually trigger an index refresh in higher environments? (if you don't have it already, install jq before proceeding)

A: Ensure trigger-update-job.sh is executable, then copy the CircleCI token from 1Password and use it to run the following command in your terminal:

CIRCLE_API_USER_TOKEN= scripts/search/trigger-update-job.sh

Search Queries

Q: How do I run test search queries in higher environments?

A: Copy the elastic credentials from 1Password and use them to run the following command in your terminal:

ELASTIC_USERNAME= ELASTIC_PASSWORD= NODE_ENV= npx babel-node ./scripts/search/query-index.js

Search Queries Q: How do I run test search queries in higher environments?

A: Copy the elastic credentials from 1Password and use them to run the following command in your terminal:

ELASTIC_USERNAME= ELASTIC_PASSWORD= NODE_ENV= npx babel-node ./scripts/search/query-index.js

AWS

Q: How do I switch to an elevated role in AWS Console?

A: In the upper right hand corner of the AWS Console, open the dropdown under your email. Copy the account number next to "My Account" and click "Switch Roles". You should be taken to a screen that will ask for your "Account" and "Role". Paste your account number into the "Account" field and enter "federated-admin" into the "Role" field. You should not need a display name or color selection. Hit the "Switch Role" button and you should now be able to add users, environment variables, etc.

Clone this wiki locally