Skip to content
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

Deploy fixes #298

Merged
merged 8 commits into from
Aug 6, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy-telemed-ehr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
run: pnpm install

- name: Deploy App
run: pnpm telemed-ehr-deploy ${{ github.event.inputs.environment }}
run: cd ${{ env.PACKAGE_LOCATION }} && pnpm run deploy:${{ github.event.inputs.environment }}

- name: Setup zapehr secrets
run: cd ${{ env.ZAMBDAS_LOCATION }} && pnpm setup-zapehr-secrets ${{ github.event.inputs.environment }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/build-and-deploy-telemed-intake.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Deploy Intake

env:
CI: false
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

on:
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -105,7 +110,7 @@ jobs:
run: pnpm install

- name: Deploy App
run: pnpm telemed-intake-deploy ${{ github.event.inputs.environment }}
run: cd ${{ env.PACKAGE_LOCATION }} && pnpm run deploy:${{ github.event.inputs.environment }}

- name: Setup zapehr secrets
run: cd ${{ env.ZAMBDAS_LOCATION }} && pnpm setup-zapehr-secrets ${{ github.event.inputs.environment }}
Expand Down
2 changes: 1 addition & 1 deletion packages/telemed-ehr/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"build-skeleton": "tsc && vite build --mode ${ENV}",
"test": "react-scripts test",
"eject": "react-scripts eject",
"deploy": " PREFIX=development CLOUDFRONT_ID=E10TA6FN58D1OS pnpm run ci-deploy-skeleton ENV=${ENV}",
"deploy:dev": " PREFIX=development CLOUDFRONT_ID=E10TA6FN58D1OS ENV=dev pnpm run ci-deploy-skeleton",
"ci-deploy-skeleton": "ENV=${ENV} VITE_APP_SHA=${GIT_HEAD:-$(git rev-parse --short HEAD)} VITE_APP_VERSION=$(node -pe 'require(\"./package.json\").version') pnpm run build && aws s3 sync build/ s3://ehr.ottehr.com --region us-east-1 --delete && aws cloudfront create-invalidation --distribution-id ${CLOUDFRONT_ID} --paths '/*' --region us-east-1"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/telemed-intake/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"start:local": "vite",
"build": "tsc && vite build",
"deploy": "PREFIX=development CLOUDFRONT_ID=EIYX001DGGQK8 pnpm run ci-deploy-skeleton ENV=${ENV}",
"deploy:dev": "PREFIX=development CLOUDFRONT_ID=EIYX001DGGQK8 ENV=dev pnpm run ci-deploy-skeleton",
"ci-deploy-skeleton": "ENV=${ENV} VITE_APP_SHA=${GIT_HEAD:-$(git rev-parse --short HEAD)} VITE_APP_VERSION=$(node -pe 'require(\"./package.json\").version') pnpm run build && aws s3 sync build/ s3://telemed.ottehr.com --region us-east-1 --delete && aws cloudfront create-invalidation --distribution-id ${CLOUDFRONT_ID} --paths '/*' --region us-east-1"
},
"dependencies": {
Expand All @@ -22,4 +22,4 @@
"devDependencies": {
"@types/styled-components": "^5.1.34"
}
}
}
6 changes: 0 additions & 6 deletions packages/telemed-intake/zambdas/scripts/deploy-zambdas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ const ZAMBDAS: { [name: string]: DeployZambda } = {
'GET-PRESIGNED-FILE-URL': {
type: 'http_open',
},
'CREATE-SAMPLE-APPOINTMENTS': {
type: 'cron',
schedule: {
expression: 'cron(0 0 * * ? *)',
},
},
};

const updateZambdas = async (config: any): Promise<void> => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DIST_DIR=$(realpath $SCRIPTS_DIR/../.dist)
# Every time we add a new endpoint in serverless.yml we should dublicate it's name here, otherwise it will not be deployed
# Zip

ZIP_ORDER=('get-patients' 'get-paperwork' 'create-paperwork' 'update-paperwork' 'create-appointment' 'get-appointments' 'get-schedule' 'cancel-appointment' 'get-wait-status' 'join-call' 'video-chat-invites-create' 'video-chat-invites-cancel' 'video-chat-invites-list' 'get-presigned-file-url' 'payment-methods-setup' 'payment-methods-list' 'payment-methods-set-default' 'payment-methods-delete' 'create-sample-appointments')
ZIP_ORDER=('get-patients' 'get-paperwork' 'create-paperwork' 'update-paperwork' 'create-appointment' 'get-appointments' 'get-schedule' 'cancel-appointment' 'get-wait-status' 'join-call' 'video-chat-invites-create' 'video-chat-invites-cancel' 'video-chat-invites-list' 'get-presigned-file-url' 'payment-methods-setup' 'payment-methods-list' 'payment-methods-set-default' 'payment-methods-delete')

for ZAMBDA in ${ZIP_ORDER[@]}; do
# Set up temp directory for the zip
Expand Down
12 changes: 6 additions & 6 deletions packages/telemed-intake/zambdas/scripts/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ async function createApplication(
rule: [
{
resource: [
'Zambda:Function:todo-telemed-get-patients',
'Zambda:Function:todo-telemed-get-appointments',
'Zambda:Function:todo-telemed-create-appointment',
'Zambda:Function:todo-telemed-get-paperwork',
'Zambda:Function:todo-telemed-create-paperwork',
'Zambda:Function:todo-telemed-cancel-appointment',
'Zambda:Function:telemed-get-patients',
'Zambda:Function:telemed-get-appointments',
'Zambda:Function:telemed-create-appointment',
'Zambda:Function:telemed-get-paperwork',
'Zambda:Function:telemed-create-paperwork',
'Zambda:Function:telemed-cancel-appointment',
],
action: ['Zambda:InvokeFunction'],
effect: 'Allow',
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/lib/secrets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const getOptionalSecret = (secretKey: string, secrets: Secrets | null, fa
}
}

if (value == null) {
if (!value) {
console.warn(process.env);
console.warn(`Secret or Environment Variable with key ${secretKey} was not set. Using fallback ${fallback}`);
return fallback;
Expand Down
Loading