forked from participedia/api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.env
34 lines (27 loc) · 1.54 KB
/
sample.env
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# These are used to validate Auth0 tokens
export AUTH0_CLIENT_ID=[PUT SEKRIT Auth0 IDENTITY HERE]
export AUTH0_CLIENT_SECRET=[PUT SEKRIT Auth0 KEY HERE]
# these are used to sign the AWS S3 Access
export AWS_ACCESS_KEY_ID=[PUT SEKRIT AWS IDENTITY HERE]
export AWS_SECRET_ACCESS_KEY=[PUT SEKRIT AWS KEY HERE]
export AWS_REGION=us-east-1
# Used for authentication when running tests
export BEARER_TOKEN=[PUT SUPER SEKRIT Auth0 token for automatic tests to authenticate with here]
# Some options for setting your local development database URL, choose one that works for you
# export DATABASE_URL="`heroku config:get --app participedia-[YOURNAME] DATABASE_URL`"
# export DATABASE_URL=postgres://[YOURNAME]@localhost:5432/participedia
# Uncomment to set DATABASE_URL to "postgres://" + process.env.USER + "@localhost:5432/participedia-test" when testing
# export TESTLOCAL=true
# Setup production Database URL
export DATABASE_PROD_URL="`heroku config:get --app participedia-api DATABASE_URL`"
# Wipe out the local development database and rebuild it from scratch
alias resetdb="dropdb participedia; createdb participedia; psql -d participedia -f setup.sql"
# Wipe out the local test database and rebuild it from scratch
alias resettestdb='dropdb "participedia-test"; createdb "participedia-test"; psql -d "participedia-test" -f setup.sql'
# Run a single migration on production
# Use as: "$ migrateprod 008" to run migration 8
function migrateprod {
printf -v item "%03d" $1
psql -d "${DATABASE_PROD_URL}" -f "migrations/migration_${item}.sql";
}
export -f migrateprod