Skip to content

Commit

Permalink
CMDCT-4243 - solves issues preventing app from running locally
Browse files Browse the repository at this point in the history
  • Loading branch information
peoplespete committed Jan 21, 2025
1 parent ca71811 commit 2211e55
Show file tree
Hide file tree
Showing 5 changed files with 284 additions and 50 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"serverless-dotenv-plugin": "^3.0.0",
"serverless-dynamodb": "^0.2.54",
"serverless-iam-helper": "github:Enterprise-CMCS/serverless-iam-helper",
"serverless-offline": "^13.5.0",
"serverless-offline": "^14.4.0",
"serverless-plugin-scripts": "^1.0.2",
"serverless-stack-termination-protection": "^2.0.2",
"typescript": "^4.6.3",
Expand Down
1 change: 1 addition & 0 deletions services/database/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ provider:
- "s3:GetObject"
- "s3:ListBucket"
- "s3:PutObject"
Resource: "*"
resources:
Resources:
BannerTable:
Expand Down
6 changes: 4 additions & 2 deletions services/output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ $example}

service=${1}
output=${2}
stage=${3:-dev}
stage=${3}

if [ $output == "url" ]; then
output="CloudFrontEndpointUrl"
fi

cd $service && serverless info --stage $stage --verbose | sed -e '1,/^Stack Outputs/d' -e '$d' | sed -n -e "s/^.*$output: //p" && cd ..
cd $service
serverless info --stage $stage --json | jq --raw-output --arg output $output '.outputs[] | select(.OutputKey == $output) | .OutputValue'
cd ..
26 changes: 3 additions & 23 deletions src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ async function run_db_locally(runner: LabeledProcessRunner) {
["yarn", "install"],
"services/database"
);
await runner.run_command_and_output(
"db svls doc",
["serverless", "doctor"],
"services/database"
);
await runner.run_command_and_output(
"db svls",
["serverless", "dynamodb", "install", "--stage", "local"],
Expand Down Expand Up @@ -76,11 +71,6 @@ async function run_api_locally(runner: LabeledProcessRunner) {
["yarn", "install"],
"services/app-api"
);
runner.run_command_and_output(
"api svls doc",
["serverless", "doctor"],
"services/app-api"
);
runner.run_command_and_output(
"api",
[
Expand All @@ -106,11 +96,6 @@ async function run_api_locally(runner: LabeledProcessRunner) {
// "services/uploads"
// );
// runner.run_command_and_output(
// "s3 svls doc",
// ["serverless", "doctor"],
// "services/uploads"
// );
// runner.run_command_and_output(
// "s3",
// ["serverless", "s3", "start", "--stage", "local"],
// "services/uploads"
Expand All @@ -124,11 +109,6 @@ async function run_fe_locally(runner: LabeledProcessRunner) {
["yarn", "install"],
"services/ui-src"
);
runner.run_command_and_output(
"ui svls doc",
["serverless", "doctor"],
"services/ui-src"
);
await runner.run_command_and_output(
"ui conf",
["./scripts/configure-env.sh", "local"],
Expand All @@ -142,10 +122,10 @@ async function run_fe_locally(runner: LabeledProcessRunner) {
async function run_all_locally() {
const runner = new LabeledProcessRunner();

run_db_locally(runner);
await run_db_locally(runner);
// run_s3_locally(runner);
run_api_locally(runner);
run_fe_locally(runner);
await run_api_locally(runner);
await run_fe_locally(runner);
}

async function install_deps_for_services(runner: LabeledProcessRunner) {
Expand Down
Loading

0 comments on commit 2211e55

Please sign in to comment.