-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Whitespace * Rewrite 11 but good this time * chore: Split dev/prod/test dbs - Make database name consistent; rename `hsl`, `hsl_dev` and `hsl_test` dbs to `members_api_db_${NODE_ENV}` - `postgres` container initializes multiple databases - Rename npm task `up` to `db_migrate_latest` - Rename npm task `down` to `db_migrate_rollback` - Rename npm task `seed` to `db_seed` - Add npm task `db_migrate_up` and `db_migrate_down` - Add npm task `db_clear` - Add utility to clear db records between test runs * get events tests passing, prep app for heroku * Update readme * Apply Duncan's fixes for new test methodology Co-authored-by: Duncan Beevers <[email protected]>
- Loading branch information
1 parent
17a7517
commit 4b89b3f
Showing
36 changed files
with
623 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,4 @@ COPY docker-run.sh /home/app/ | |
|
||
RUN npm ci | ||
|
||
CMD /home/app/docker-run.sh | ||
CMD "/home/app/docker-run.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "Members API", | ||
"description": "API for the Members App", | ||
"repository": "https://github.com/heatsynclabs/members_api", | ||
"env": { | ||
"NODE_ENV": { | ||
"description": "Run the app in production/development/test", | ||
"value": "development" | ||
}, | ||
"JWT_KEY": { | ||
"description": "Encryption key for JSON Web Tokens", | ||
"value": "some random key" | ||
}, | ||
"PGSSLMODE": { | ||
"description": "How to run Postgres SSL", | ||
"value": "no-verify" | ||
}, | ||
"SENDGRID_API_KEY": { | ||
"description": "API for sending emails when local methods are unavailable" | ||
}, | ||
"ADMIN_EMAIL": { | ||
"description": "Address to send email from", | ||
"value": "[email protected]" | ||
}, | ||
"SERVER_URL": { | ||
"description": "Base URL of this API to link users to when sending them login emails, no trailing slash" | ||
}, | ||
"DOMAIN_LOCATION": { | ||
"description": "Base URL of the UI to redirect users on login, no trailing slash" | ||
}, | ||
"DOMAIN_LOCATION_DEV": { | ||
"description": "Base URL of the UI to redirect users in dev mode, no trailing slash" | ||
}, | ||
"DEV_COOKIES": { | ||
"description": "1 or 0, to set cookie security weak or strong" | ||
}, | ||
"DEV_SAME_SITE": { | ||
"description": "1 or 0, to set cookie same-site protection lax or none" | ||
} | ||
}, | ||
"addons": [ | ||
{ | ||
"plan": "heroku-postgresql" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,31 @@ | ||
# Copyright 2019 Iced Development, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
echo "Database URL is $DATABASE_URL" | ||
echo "NODE_ENV is $NODE_ENV" | ||
|
||
echo "Setting PATH from $PATH ..." | ||
export PATH=$PATH:$(pwd)/node_modules/.bin | ||
echo "... to $PATH" | ||
|
||
if [[ $PORT ]] | ||
if [ $PORT ] | ||
then | ||
export NODE_PORT=$PORT | ||
echo "Setting NODE_PORT=$PORT based on PORT" | ||
fi | ||
if [[ $NPMINSTALL == 1 ]] | ||
|
||
if [ $NPMINSTALL == 1 ] | ||
then | ||
npm install | ||
fi | ||
|
||
if [[ $NODE_ENV == "production" ]] | ||
if [ $NODE_ENV == "production" ] | ||
then | ||
npm run start | ||
elif [[ $NODE_ENV == "development" ]] | ||
elif [ $NODE_ENV == "development" ] | ||
then | ||
npm run up | ||
npm run seed | ||
npm run db_migrate_latest | ||
npm run develop | ||
elif [[ $NODE_ENV == "test" ]] | ||
elif [ $NODE_ENV == "test" ] | ||
then | ||
npm run up | ||
npm run db_migrate_rollback_all | ||
npm run db_migrate_latest | ||
npm run test | ||
else | ||
echo "Improper NODE_ENV=$NODE_ENV, stopping" | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.