Skip to content

use single env file #425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2021
Merged
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
20 changes: 3 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,7 @@
BUSAPI_URL=http://dockerhost:8002/v5
```

1. In the `./local` folder create `taas-es-processor.env` file with the next environment variables.<br>

```bash
# Auth0 config
AUTH0_URL=
AUTH0_AUDIENCE=
AUTH0_CLIENT_ID=
AUTH0_CLIENT_SECRET=
# Locally deployed services (via docker-compose)
KAFKA_URL=kafka:9093
ES_HOST=http://elasticsearch:9200
BUSAPI_URL=http://tc-bus-api:8002/v5
```

- Values from these file would be automatically used by many `npm` commands.
- Values from this file would be automatically used by many `npm` commands.
- ⚠️ Never commit this file or its copy to the repository!

1. Set `dockerhost` to point the IP address of Docker. Docker IP address depends on your system. For example if docker is run on IP `127.0.0.1` add a the next line to your `/etc/hosts` file:
Expand Down Expand Up @@ -234,8 +220,8 @@ To be able to change and test `taas-es-processor` locally you can follow the nex
| `npm run cov` | Code Coverage Report. |
| `npm run migrate` | Run any migration files which haven't run yet. |
| `npm run migrate:undo` | Revert most recent migration. |
| `npm run demo-payment-scheduler` | Create 1000 Work Periods Payment records in with status "scheduled" and various "amount" |
| `npm run emsi-mapping` | mapping EMSI tags to topcoder skills |
| `npm run demo-payment-scheduler` | Create 1000 Work Periods Payment records in with status "scheduled" and various "amount" |
| `npm run emsi-mapping` | mapping EMSI tags to topcoder skills |

## Import and Export data

Expand Down
10 changes: 8 additions & 2 deletions local/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,14 @@ services:
depends_on:
- kafka-client
- elasticsearch
env_file:
- taas-es-processor.env
environment:
- KAFKA_URL=kafka:9093
- ES_HOST=http://elasticsearch:9200
- BUSAPI_URL=http://tc-bus-api:8002/v5
- AUTH0_URL=${AUTH0_URL}
- AUTH0_AUDIENCE=${AUTH0_AUDIENCE}
- AUTH0_CLIENT_ID=${AUTH0_CLIENT_ID}
- AUTH0_CLIENT_SECRET=${AUTH0_CLIENT_SECRET}

tc-bus-api:
container_name: tc-bus-api
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"migrate": "npx sequelize db:migrate",
"migrate:undo": "npx sequelize db:migrate:undo",
"test": "mocha test/unit/*.test.js --timeout 30000 --require test/prepare.js --exit",
"services:up": "docker-compose -f ./local/docker-compose.yml up -d",
"services:up": "docker-compose -f ./local/docker-compose.yml --env-file .env up -d",
"services:down": "docker-compose -f ./local/docker-compose.yml down",
"services:logs": "docker-compose -f ./local/docker-compose.yml logs",
"local:init": "npm run local:reset && npm run data:import -- --force",
Expand Down