Skip to content

Commit

Permalink
Remove docs related to Elastic Beanstalk
Browse files Browse the repository at this point in the history
See #16.
  • Loading branch information
liammulh committed May 15, 2024
1 parent 1f4535b commit 73942e0
Showing 1 changed file with 1 addition and 66 deletions.
67 changes: 1 addition & 66 deletions doc/howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,69 +69,4 @@ A commit should almost always be linked to a GitHub issue.
For:
https://github.com/org/repo/issues/123
```

## Set up Postgres locally

This how-to guide assumes you are using macOS. The steps will be
different for different operating systems.

- Install Postgres: `brew install postgresql@16`
- Start Postgres now and restart at login: `brew services start postgresql@16`
- Add Postgres to your PATH: `export PATH="/opt/homebrew/opt/postgresql@16/bin:$PATH"`
- If you are using Zsh (the default shell on macOS), I believe this
can go in `.zshrc` in your home directory.
- If you use a different shell, the file you put this in might be
different, and the syntax might be different.
- Either reload your shell configuration or restart your terminal
session so Postgres executables will be on your PATH.
- Run `which psql`. You should see: `/opt/homebrew/opt/postgresql@16/bin/psql`
- Enter the Postgres shell as the default user: `psql postgres`
- Create the affiliations database: `CREATE DATABASE affils;`
- Create a new user for the affiliations service:
```
CREATE USER affils WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE affils TO affils;
```
- Change the owner of the database:
```
ALTER DATABASE affils OWNER TO affils;
```
- Create and fill out a `.env.local` file in the root of the
affiliations repository.
- The values you should fill in should be in the `.env.template`
file.
- See [the doc on environment variables](./envars.md) for more info
on environment variables.
- The default Postgres port is 5432.
- For local development, the host should be localhost.

## View info on AWS

The affils service is deployed to AWS's Elastic Beanstalk service. If
you use your Stanford credentials to log in to AWS, choose the
production profile, and set your region to Oregon (us-west-2), and then
you navigate to the Elastic Beanstalk console, you should see an Elastic
Beanstalk environment called `affils-env`. The `affils-env` environment
contains the `affils` application. If you click the `affils`
application, you should be able to view information about the affils
service.

## View logs on AWS

When running locally, logs are written to stdout. When running on AWS,
logs can be viewed in CloudWatch. To view the logs, navigate to the
CloudWatch web console, then in the side bar click the link to the log
groups page. Then look for the `web.stdout.log` log group. Then click
the appropriate log stream (probably the most recent one).

## Deploy to AWS

To deploy the files from your computer, enter the following:

```
inv deploy
```

This command should upload the affils files from your computer to AWS's
Elastic Beanstalk service.
```

0 comments on commit 73942e0

Please sign in to comment.