-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from rtjord/dev
Deploy to production
- Loading branch information
Showing
93 changed files
with
12,907 additions
and
4,339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,8 +38,8 @@ jobs: | |
|
||
- name: Build | ||
working-directory: backend | ||
run: npm run build && sam build --use-container | ||
run: npm run build:linux | ||
|
||
- name: Configure AWS Credentials for Development Account | ||
uses: aws-actions/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ jobs: | |
|
||
- name: Build | ||
working-directory: backend | ||
run: npm run build && sam build --use-container | ||
run: npm run build:linux | ||
|
||
- name: Configure AWS Credentials for Production Account | ||
uses: aws-actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
.env | ||
*.zip | ||
|
||
# amplify | ||
node_modules | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as fs from 'fs'; | ||
import * as path from 'path'; | ||
|
||
function copyFile(src, dest) { | ||
const destDir = path.dirname(dest); | ||
if (!fs.existsSync(destDir)) { | ||
fs.mkdirSync(destDir, { recursive: true }); | ||
} | ||
fs.copyFileSync(src, dest); | ||
console.log(`Copied ${src} to ${dest}`); | ||
} | ||
|
||
// For each handler subdirectory in src/handlers, copy the package.json file to dist/handlers | ||
const handlersDir = 'src/handlers'; | ||
const destBaseDir = 'dist/handlers'; | ||
|
||
for (const handler of fs.readdirSync(handlersDir)) { | ||
const src = path.join(handlersDir, handler, 'package.json'); | ||
const dest = path.join(destBaseDir, handler, 'package.json'); | ||
|
||
if (fs.existsSync(src)) { | ||
copyFile(src, dest); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
{ | ||
"pathParameters": { | ||
"name": "example1" | ||
}, | ||
"httpMethod": "GET", | ||
"requestContext": { | ||
"resourcePath": "/package/byName/{name}", | ||
"httpMethod": "GET" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"body": "{\"metadata\":{\"Name\":\"Underscore\",\"Version\":\"1.0.0\"},\"data\":{\"Content\":\"<base64_encoded_content>\",\"PackageRating\":{\"RampUp\":0.7,\"Correctness\":0.8,\"BusFactor\":0.9,\"ResponsiveMaintainer\":0.85,\"LicenseScore\":0.95,\"GoodPinningPractice\":0.8,\"PullRequest\":0.9,\"NetScore\":0.85}},\"user\":{\"name\":\"John Doe\",\"isAdmin\":true}}", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"requestContext": { | ||
"httpMethod": "POST", | ||
"path": "/package" | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"pathParameters": { | ||
"id": "underscore:1.0.0" | ||
}, | ||
"requestContext": { | ||
"httpMethod": "DELETE", | ||
"path": "/package/underscore:1.0.0" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"resource": "/package/{id}", | ||
"path": "/package/underscore:1.0.0", | ||
"httpMethod": "GET", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"pathParameters": { | ||
"id": "underscore:1.0.0" | ||
}, | ||
"requestContext": { | ||
"authorizer": { | ||
"claims": { | ||
"name": "John Doe", | ||
"isAdmin": true | ||
} | ||
} | ||
}, | ||
"body": null, | ||
"isBase64Encoded": false | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"pathParameters": { | ||
"id": "Underscore:1.0.0" | ||
}, | ||
"body": "{\n \"metadata\": {\n \"Name\": \"underscore\",\n \"Version\": \"1.0.0\"\n },\n \"data\": {\n \"Content\": \"UEsDBBQAAAAIAAeLbUst1IfSAgAAAAIAAAALABwAaW5kZXguanNVVAkAA2FkZGOWP6NpX3V4CwABBPUBAAAEFAAAAGlmIChwcm9jZXNzLmFyZ3YubGVuZ3RoID09PSA3KSB7XG4gICAgY29uc29sZS5sb2coJ1N1Y2Nlc3MnKTtcbiAgICBwcm9jZXNzLmV4aXQoMCk7XG59IGVsc2Uge1xuICAgIGNvbnNvbGUubG9nKCdGYWlsZWQnKTtcbiAgICBwcm9jZXNzLmV4aXQoMSk7XG59XG4=\",\n \"URL\": null,\n \"JSProgram\": \"if (process.argv.length === 7) { console.log('Success'); process.exit(0); } else { console.log('Failed'); process.exit(1); }\"\n }\n}", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as dotenv from 'dotenv'; | ||
|
||
dotenv.config(); // Load environment variables from .env |
Oops, something went wrong.