Skip to content

Commit

Permalink
Amends to countryconfig files for configurability
Browse files Browse the repository at this point in the history
  • Loading branch information
euanmillar committed Feb 20, 2024
1 parent dc3cd6c commit e1ac7c1
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 86 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
secret: ${{ github.TOKEN }}
approvers: euanmillar,rikukissa
minimum-approvals: 1
issue-title: 'Deploy (Prod): core: ${{ github.event.inputs.core-image-tag }} country config: ${{ github.event.inputs.countryconfig-image-tag }}'
issue-body: 'Please approve or deny the deployment of core: ${{ github.event.inputs.core-image-tag }} country config: ${{ github.event.inputs.countryconfig-image-tag }} to production'
issue-title: 'Deploy (${{ github.event.inputs.environment }}): core: ${{ github.event.inputs.core-image-tag }} country config: ${{ github.event.inputs.countryconfig-image-tag }}'
issue-body: 'Please approve or deny the deployment of core: ${{ github.event.inputs.core-image-tag }} country config: ${{ github.event.inputs.countryconfig-image-tag }} to ${{ github.event.inputs.environment }}'
exclude-workflow-initiator-as-approver: false
- name: Clone core
uses: actions/checkout@v3
Expand Down
48 changes: 0 additions & 48 deletions .github/workflows/generate-demo-data.yml

This file was deleted.

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
3 changes: 0 additions & 3 deletions infrastructure/docker-compose.staging-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/metrics?replicaSet=rs0
Expand All @@ -48,15 +47,13 @@ services:

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

user-mgnt:
environment:
- QA_ENV=true
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN}
- MONGO_URL=mongodb://user-mgnt:${USER_MGNT_MONGODB_PASSWORD}@mongo1/user-mgnt?replicaSet=rs0
Expand Down
16 changes: 0 additions & 16 deletions infrastructure/server-setup/backups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,6 @@
tags:
- backups

- name: Check if authorized_keys already exists
stat:
path: '{{ external_backup_server_user_home }}/.ssh/authorized_keys'
register: file_check
tags:
- backups

- name: Ensure .ssh directory exists for external backup server user
file:
path: '{{ external_backup_server_user_home }}/.ssh'
state: directory
owner: '{{ external_backup_server_user }}'
mode: '0700'
tags:
- backups

- name: Ensure backup application servers can login to backup server
blockinfile:
path: '{{ external_backup_server_user_home }}/.ssh/authorized_keys'
Expand Down
4 changes: 2 additions & 2 deletions infrastructure/server-setup/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ all:
sudoer: true

docker-manager-first:
dev:
qa: # @todo set this to be the hostname of your target server
hosts:
dev: # @todo set this to be the hostname of your target server
ansible_host: '44.44.44.44' # @todo set this to be the IP address of your server
data_label: data1 # for manager machines, this should always be "data1"

Expand Down
2 changes: 1 addition & 1 deletion infrastructure/server-setup/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ docker-workers:

backups:
hosts:
qa:
backup: # @todo set this to be the hostname of your backup server
ansible_host: '66.66.66.66'
9 changes: 0 additions & 9 deletions infrastructure/server-setup/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ all:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABg...Z/rhU= provision@github-runner-243 # example provision user key
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABg...Z/rhU= provision@github-runner-244 # example provision user key

# If the machine is repurposed to also be the backup host, we need to add more keys to the authorized_keys file so that
# when the application servers get provisioned, the provision user of this machine can be used.
#
# @todo remove this key if the machine is not used as a backup host.
# Otherwise, add the public key of the private key that's used for the "provision" user on the server of which backups this machine hosts.
additional_keys_for_provisioning_user:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABg...Z/rhU= provision@github-runner-243 # example provision user key
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABg...Z/rhU= provision@github-runner-244 # example provision user key

docker-manager-first:
hosts:
qa: # @todo set this to be the hostname of your target server
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/server-setup/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ docker-workers: {}
# @todo if you do not intend to set up automatic sync from the backup server, you can remove this section.
backups:
hosts:
qa:
backup: # @todo set this to be the hostname of your backup server
ansible_host: '66.66.66.66' # set this to be the IP address of your backup server
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)
}
1 change: 1 addition & 0 deletions src/data-seeding/employees/source/prod-employees.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
primaryOfficeId,givenNames,familyName,systemRole,role,mobile,username,email,password

0 comments on commit e1ac7c1

Please sign in to comment.