Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
# Installation
## Locally
* postgres server installed and running
* `brew install postgres`
* `pg_ctl -D /usr/local/var/postgres start`
* heroku cli installed
* `brew install heroku`
* `brew install postgres`
* `pg_ctl start -D /usr/local/var/postgres`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did the previous version not work on your machine?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope

mbp-IT002597:~ ethomas$ pg_ctl --version
pg_ctl (PostgreSQL) 10.3
mbp-IT002597:~ ethomas$ pg_ctl --help | head -10
pg_ctl is a utility to initialize, start, stop, or control a PostgreSQL server.

Usage:
  pg_ctl init[db] [-D DATADIR] [-s] [-o OPTIONS]
  pg_ctl start    [-D DATADIR] [-l FILENAME] [-W] [-t SECS] [-s]
                  [-o OPTIONS] [-p PATH] [-c]
  pg_ctl stop     [-D DATADIR] [-m SHUTDOWN-MODE] [-W] [-t SECS] [-s]
  pg_ctl restart  [-D DATADIR] [-m SHUTDOWN-MODE] [-W] [-t SECS] [-s]
                  [-o OPTIONS] [-c]
  pg_ctl reload   [-D DATADIR] [-s]

I tried checking the pg_ctl release notes to see if something changed. Couldn't find anything. But putting the optional args before start resulted in an error for me

* golang installed
* `brew install go`
* godep installed:
* `go get github.com/tools/godep`
* `brew install go`
* godep installed:
* `go get github.com/tools/godep`
* create database
* `psql -d postgres -c "create database cerealnotes_test"`
* Refer to `migrations/README.md` to create relevant database tables
* export environment variables
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you used heroku local you wouldn't need to do this

```
export DATABASE_URL=postgres://localhost:5432/cerealnotes_test?sslmode=disable
export TOKEN_SIGNING_KEY=abcdefg
export PORT=8000
```
* run the app
* `go build && ./cerealnotes`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this instead of go install && heroku local?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to avoid heroku


## Heroku
* heroku cli installed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be installed to run locally

* `brew install heroku`
* heroku instance
* instance connected to postgres db

# Running CerealNotes

Expand Down
8 changes: 4 additions & 4 deletions migrations/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Locally:
1. first make sure that postgres is running.
* If installed via homebrew on a macOS: `pg_ctl -D /usr/local/var/postgres start`
# Locally:
1. first make sure that postgres is running.
* If installed via homebrew on a macOS: `pg_ctl start -D /usr/local/var/postgres`
2. then run migration locally
* `psql < *MIGRATION_NAME*`

# On Heroku:
# On Heroku:

1. `heroku pg:psql < *MIGRATION_NAME*`