Skip to content

Commit

Permalink
automation update
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigues committed Mar 10, 2021
1 parent e199229 commit a39977a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions amplify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ backend:
- sed "s|%LambdaArn%|$LAMBDA_ARN|g" notification.json > notification.s3
- aws s3api put-bucket-notification-configuration --bucket $S3_BUCKET --notification-configuration file://notification.s3 --output text
- aws s3 cp ./src/backend/csv/thesaurus_medical.ths s3://$S3_BUCKET/public/thesaurus_medical.ths
- export LAMBDA_UPDATE=$(aws ssm get-parameter --name /mri-sched/lambdaupdateweightsarn --query Parameter.Value --output text)
- aws lambda invoke --function-name $LAMBDA_UPDATE

frontend:
phases:
Expand Down
3 changes: 0 additions & 3 deletions src/backend/init_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ CREATE TABLE IF NOT EXISTS specialty_tags (
UPDATE mri_rules
SET bp_tk = to_tsvector(body_part);

UPDATE mri_rules
SET info_weighted_tk = to_tsvector(info)

CREATE INDEX info_weighted_idx
ON mri_rules
USING GIN (info_weighted_tk);
Expand Down
13 changes: 11 additions & 2 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,7 @@ Resources:
sudo -u postgres psql -f ./src/backend/init_db.sql
sudo -u postgres psql -d rules -c "GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO $DBUSER;"
sudo -u postgres psql -d rules -c "GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO $DBUSER;"
sudo -u postgres psql -d rules -c "GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA public TO $DBUSER;"

sudo -u postgres psql -d rules -c "GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA public TO $DBUSER;"

sudo systemctl restart postgresql

Expand Down Expand Up @@ -656,6 +655,16 @@ Resources:
!GetAtt Thesaurus.Arn
Description: LambdaArn Thesaurus


lambdaUpdateWeightsParameter:
Type: AWS::SSM::Parameter
Properties:
Name: /mri-sched/lambdaupdateweightsarn
Type: String
Value:
!GetAtt UpdateWeights.Arn
Description: LambdaArn UpdateWeights

Outputs:
Preprocess:
Value: !GetAtt Preprocess.Arn
Expand Down

0 comments on commit a39977a

Please sign in to comment.