forked from jig21nesh/postfacto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update deps.sh and run.sh, begin working on E2E tests and packaging
- Loading branch information
David Evans
authored and
Your Name
committed
Jan 22, 2019
1 parent
3073d82
commit c21d9f2
Showing
13 changed files
with
112 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
nodejs 6.14.4 | ||
nodejs 11.6.0 | ||
ruby 2.4.0 |
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 |
---|---|---|
|
@@ -27,7 +27,19 @@ You can run Postfacto locally at [https://localhost:3000]() by running: | |
./run.sh | ||
``` | ||
|
||
The admin dashboard will be available at [https://localhost:4000/admin](). You can create an admin user using the following rake task in the `api` directory: | ||
Or to use real authentication (this will use no authentication unless `config.js` has a Google Auth client ID): | ||
|
||
```bash | ||
./run.sh --real-auth | ||
``` | ||
|
||
--- | ||
|
||
The admin dashboard will be available at [https://localhost:4000/admin](). | ||
|
||
A default admin user '[email protected]' with password 'password' will be created | ||
|
||
You can create other admin users using the following rake task in the `api` directory: | ||
|
||
```bash | ||
[email protected] ADMIN_PASSWORD=password rake admin:create_user | ||
|
@@ -41,11 +53,24 @@ You can run the tests for the whole project in the root directory by simply runn | |
./test.sh | ||
``` | ||
|
||
The following sections show how to run individual test suites during development. | ||
|
||
### Web | ||
|
||
To run the tests in "watch mode" (runs any tests touched by unstaged Git changes and re-runs tests when files change): | ||
|
||
```bash | ||
cd web | ||
npm test | ||
``` | ||
|
||
(this can also be written as `npm --prefix=web test` if you prefer). | ||
|
||
To run all the tests: | ||
|
||
```bash | ||
cd web | ||
gulp spec-app | ||
CI=true npm test | ||
``` | ||
|
||
### API | ||
|
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,3 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker run -it --entrypoint /bin/bash -p 3000:3000 -p 4000:4000 -v $(PWD):/postfacto postfacto/postfacto | ||
docker run -it --entrypoint /bin/bash -p 3000:3000 -p 4000:4000 -v "$(pwd)":/postfacto postfacto/postfacto |
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 |
---|---|---|
|
@@ -2,11 +2,43 @@ | |
|
||
set -e | ||
|
||
pushd api | ||
BASE_DIR="$(dirname "$0")" | ||
|
||
EXIT_SCRIPT=""; | ||
trap "eval \"\$EXIT_SCRIPT\"; sleep 1; echo 'Shutdown complete.';" EXIT | ||
|
||
ADMIN_USER='[email protected]' | ||
ADMIN_PASS='password' | ||
|
||
pushd "$BASE_DIR/api" >/dev/null | ||
bundle exec rake db:create db:migrate | ||
[email protected] ADMIN_PASSWORD=password rake admin:create_user | ||
popd | ||
ADMIN_EMAIL="$ADMIN_USER" ADMIN_PASSWORD="$ADMIN_PASS" rake admin:create_user | ||
popd >/dev/null | ||
|
||
if [[ " $* " == *' --real-auth ' ]]; then | ||
echo "Using real authentication; set google_oauth_client_id in config.js to use Google auth"; | ||
unset USE_MOCK_GOOGLE | ||
else | ||
export USE_MOCK_GOOGLE=true | ||
fi | ||
|
||
if [[ -n "$USE_MOCK_GOOGLE" ]]; then | ||
echo "Using mock google authentication server (specify --real-auth to use real auth)"; | ||
export GOOGLE_AUTH_ENDPOINT=https://localhost:3100/auth | ||
npm --prefix="$BASE_DIR/mock-google-server" start & PID_MGS=$! | ||
EXIT_SCRIPT="$EXIT_SCRIPT kill $PID_MGS || true;"; | ||
fi | ||
|
||
pushd "$BASE_DIR/api" >/dev/null | ||
bundle exec rails server -b 0.0.0.0 -p 4000 & PID_API=$! | ||
EXIT_SCRIPT="$EXIT_SCRIPT kill $PID_API || true;"; | ||
popd >/dev/null | ||
|
||
echo; | ||
echo "Created admin user '$ADMIN_USER' with password '$ADMIN_PASS'" | ||
echo "Log in to https://localhost:4000/admin to administer" | ||
echo "App will be available at https://localhost:3000/" | ||
echo "Press Ctrl+C to stop" | ||
|
||
pushd web | ||
gulp local-run | ||
popd | ||
# react-scripts clears console history so the above message disappears :( | ||
npm --prefix="$BASE_DIR/web" start |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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