Skip to content

Commit

Permalink
fix: yarn clean preserve cert file in schema discovery lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
sundersc committed May 14, 2024
1 parent 2f51801 commit 0c80ecf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/amplify-graphql-schema-generator/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.js
*.js.map
lib/*
vpc-db-lambda/lib/*
2 changes: 1 addition & 1 deletion packages/amplify-graphql-schema-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"access": "public"
},
"scripts": {
"build": "tsc && cd vpc-db-lambda && rm -rf node_modules && npm install && tsc && cp -r node_modules lib && cd lib && bestzip --force node ../../lib/rds-schema-inspector.zip ./*",
"build": "tsc && cd vpc-db-lambda && rm -rf node_modules && npm install && tsc && cp -r node_modules lib && cp -r src/certs lib/certs && cd lib && bestzip --force node ../../lib/rds-schema-inspector.zip ./*",
"watch": "tsc -w",
"clean": "rimraf ./lib && rimraf ./vpc-db-lambda/lib",
"test": "jest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ export const establishDBConnection = (config: any): any => {
const getRDSCertificate = (): string => {
// This certificate file is copied from the parent folder `amplify-graphql-schema-generator/certs/aws-rds-global-bundle.pem`.
const RDS_CERT_FILE_NAME = 'aws-rds-global-bundle.pem';
return fs.readFileSync(RDS_CERT_FILE_NAME, 'utf-8');
const certPath = `${__dirname}/certs/${RDS_CERT_FILE_NAME}`;
return fs.readFileSync(certPath, 'utf-8');
};

0 comments on commit 0c80ecf

Please sign in to comment.