Skip to content

Commit

Permalink
Merge pull request #30 from opencrvs/testing-infra-2
Browse files Browse the repository at this point in the history
Remove QA_ENV=true from production
  • Loading branch information
euanmillar authored Feb 13, 2024
2 parents ccf32f7 + 8e58a0c commit a2f2b17
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 0 additions & 3 deletions infrastructure/docker-compose.production-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ services:

metrics:
environment:
- QA_ENV=true
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN}
- MONGO_URL=mongodb://metrics:${METRICS_MONGODB_PASSWORD}@mongo1,mongo2/metrics?replicaSet=rs0
Expand All @@ -48,15 +47,13 @@ services:

auth:
environment:
- QA_ENV=true
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN}
deploy:
replicas: 2

user-mgnt:
environment:
- QA_ENV=true
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN}
- MONGO_URL=mongodb://user-mgnt:${USER_MGNT_MONGODB_PASSWORD}@mongo1,mongo2/user-mgnt?replicaSet=rs0
Expand Down
5 changes: 4 additions & 1 deletion src/data-seeding/employees/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
*
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
*/
import { QA_ENV } from '@countryconfig/constants'
import { readCSVToJSON } from '@countryconfig/utils'
import { Request, ResponseToolkit } from '@hapi/hapi'

export async function usersHandler(_: Request, h: ResponseToolkit) {
const users: unknown[] = await readCSVToJSON(
'./src/data-seeding/employees/source/default-employees.csv'
process.env.NODE_ENV === 'production' && !QA_ENV
? './src/data-seeding/employees/source/prod-employees.csv'
: './src/data-seeding/employees/source/test-employees.csv'
)
return h.response(users)
}
2 changes: 2 additions & 0 deletions src/data-seeding/employees/source/prod-employees.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
primaryOfficeId,givenNames,familyName,systemRole,role,mobile,username,email,password
CRVS_OFFICE_JWMRGwDBXK,Euan,Millar,NATIONAL_SYSTEM_ADMIN,National System Admin,,e.millar,[email protected],test

0 comments on commit a2f2b17

Please sign in to comment.