Skip to content

Commit

Permalink
CMDCT-4105 - trying out a deploy with sls license key
Browse files Browse the repository at this point in the history
  • Loading branch information
peoplespete committed Jan 8, 2025
1 parent 58b5385 commit fbbeacf
Show file tree
Hide file tree
Showing 11 changed files with 144 additions and 1,005 deletions.
2 changes: 2 additions & 0 deletions .env.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ CYPRESS_STATE_USER_2=op://mdct_devs/qmr_secrets/CYPRESS_STATE_USER_2
CYPRESS_STATE_USER_4=op://mdct_devs/qmr_secrets/CYPRESS_STATE_USER_4
CYPRESS_ADMIN_USER=op://mdct_devs/qmr_secrets/CYPRESS_ADMIN_USER
CYPRESS_QMR_PASSWORD=op://mdct_devs/qmr_secrets/CYPRESS_QMR_PASSWORD # pragma: allowlist secret

SERVERLESS_LICENSE_KEY=op://mdct_devs/qmr_secrets/SERVERLESS_LICENSE_KEY
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ jobs:
run: |
echo "PATH=$(pwd)/node_modules/.bin/:$PATH" >> $GITHUB_ENV
- name: deploy
env:
SERVERLESS_LICENSE_KEY: ${{ secrets.SERVERLESS_LICENSE_KEY }}
run: |
# When deploying multiple copies of this quickstart to the same AWS Account (not ideal), a prefix helps prevent stepping on each other.
# This can optionally be set as an GitHub Actions Secret
Expand Down
2 changes: 1 addition & 1 deletion run
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fi
# check serverless is installed globally.
if ! which serverless > /dev/null ; then
echo "installing serverless globally"
yarn global add serverless@3.38.0
yarn global add serverless@4.4.18
fi

# have to ensure that yarn install is up to date.
Expand Down
88 changes: 44 additions & 44 deletions serverless-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,51 @@ services:
# wave 1: no dependencies
database:
path: services/database
topics:
path: services/topics
ui:
path: services/ui
# topics:
# path: services/topics
# ui:
# path: services/ui

# wave 2: depends on database
uploads:
path: services/uploads
params:
MeasureTable: ${database.MeasureTable}
CoreSetTable: ${database.CoreSetTable}
RateTable: ${database.RateTable}
# # wave 2: depends on database
# uploads:
# path: services/uploads
# params:
# MeasureTable: ${database.MeasureTable}
# CoreSetTable: ${database.CoreSetTable}
# RateTable: ${database.RateTable}

app-api:
path: services/app-api
params:
CoreSetTable: ${database.CoreSetTable}
CoreSetTableStreamArn: ${database.CoreSetTableStreamArn}
MeasureTable: ${database.MeasureTable}
MeasureTableStreamArn: ${database.MeasureTableStreamArn}
RateTable: ${database.RateTable}
RateTableStreamArn: ${database.RateTableStreamArn}
BannerTableName: ${database.BannerTableName}
# app-api:
# path: services/app-api
# params:
# CoreSetTable: ${database.CoreSetTable}
# CoreSetTableStreamArn: ${database.CoreSetTableStreamArn}
# MeasureTable: ${database.MeasureTable}
# MeasureTableStreamArn: ${database.MeasureTableStreamArn}
# RateTable: ${database.RateTable}
# RateTableStreamArn: ${database.RateTableStreamArn}
# BannerTableName: ${database.BannerTableName}

# wave 3: depends on many
ui-auth:
path: services/ui-auth
params:
AttachmentsBucketArn: ${uploads.AttachmentsBucketArn}
ApiGatewayRestApiName: ${app-api.ApiGatewayRestApiName}
ApplicationEndpointUrl: ${ui.ApplicationEndpointUrl}
# # wave 3: depends on many
# ui-auth:
# path: services/ui-auth
# params:
# AttachmentsBucketArn: ${uploads.AttachmentsBucketArn}
# ApiGatewayRestApiName: ${app-api.ApiGatewayRestApiName}
# ApplicationEndpointUrl: ${ui.ApplicationEndpointUrl}

# wave 4: depends on most
ui-src:
path: services/ui-src
params:
ApiRegion: ${app-api.Region}
ApiGatewayRestApiUrl: ${app-api.ApiGatewayRestApiUrl}
CognitoRegion: ${ui-auth.Region}
IdentityPoolId: ${ui-auth.IdentityPoolId}
UserPoolId: ${ui-auth.UserPoolId}
UserPoolClientId: ${ui-auth.UserPoolClientId}
UserPoolClientDomain: ${ui-auth.UserPoolClientDomain}
AttachmentsBucketRegion: ${uploads.Region}
AttachmentsBucketName: ${uploads.AttachmentsBucketName}
S3BucketName: ${ui.S3BucketName}
CloudFrontDistributionId: ${ui.CloudFrontDistributionId}
ApplicationEndpointUrl: ${ui.ApplicationEndpointUrl}
# # wave 4: depends on most
# ui-src:
# path: services/ui-src
# params:
# ApiRegion: ${app-api.Region}
# ApiGatewayRestApiUrl: ${app-api.ApiGatewayRestApiUrl}
# CognitoRegion: ${ui-auth.Region}
# IdentityPoolId: ${ui-auth.IdentityPoolId}
# UserPoolId: ${ui-auth.UserPoolId}
# UserPoolClientId: ${ui-auth.UserPoolClientId}
# UserPoolClientDomain: ${ui-auth.UserPoolClientDomain}
# AttachmentsBucketRegion: ${uploads.Region}
# AttachmentsBucketName: ${uploads.AttachmentsBucketName}
# S3BucketName: ${ui.S3BucketName}
# CloudFrontDistributionId: ${ui.CloudFrontDistributionId}
# ApplicationEndpointUrl: ${ui.ApplicationEndpointUrl}
2 changes: 1 addition & 1 deletion services/app-api/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package:
individually: true

plugins:
- serverless-plugin-typescript
# - serverless-plugin-typescript
- serverless-associate-waf
- "@enterprise-cmcs/serverless-waf-plugin"
- serverless-offline-ssm
Expand Down
6 changes: 3 additions & 3 deletions services/topics/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ provider:
name: aws
runtime: nodejs20.x
region: us-east-1
stackTags:
stackTags:
PROJECT: ${self:custom.project}
SERVICE: ${self:service}
SERVICE: ${self:service}
iam:
role:
path: ${env:IAM_PATH, ssm:/configuration/${self:custom.stage}/iam/path, ssm:/configuration/default/iam/path, "/"}
Expand Down Expand Up @@ -94,7 +94,7 @@ functions:
securityGroupIds:
- Ref: LambdaSecurityGroup
subnetIds: ${self:custom.privateSubnets}
timeout: 300
timeout: 300

resources:
Resources:
Expand Down
2 changes: 1 addition & 1 deletion services/ui-auth/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ provider:
region: us-east-1
stackTags:
PROJECT: ${self:custom.project}
SERVICE: ${self:service}
SERVICE: ${self:service}
iam:
role:
path: ${ssm:/configuration/${self:custom.stage}/iam/path, ssm:/configuration/default/iam/path, "/"}
Expand Down
2 changes: 1 addition & 1 deletion services/ui-src/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ provider:
region: us-east-1
stackTags:
PROJECT: ${self:custom.project}
SERVICE: ${self:service}
SERVICE: ${self:service}

custom:
project: "qmr"
Expand Down
2 changes: 1 addition & 1 deletion services/ui/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ provider:
region: us-east-1
stackTags:
PROJECT: ${self:custom.project}
SERVICE: ${self:service}
SERVICE: ${self:service}
iam:
role:
path: ${ssm:/configuration/${self:custom.stage}/iam/path, ssm:/configuration/default/iam/path, "/"}
Expand Down
5 changes: 4 additions & 1 deletion src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ async function install_deps_for_services(runner: LabeledProcessRunner) {
async function deploy(options: { stage: string }) {
const runner = new LabeledProcessRunner();
await install_deps_for_services(runner);
const deployCmd = ["sls", "deploy", "--stage", options.stage];
const someCmd = ["sls", "--version"];
await runner.run_command_and_output("SLS Version", someCmd, ".");

const deployCmd = ["sls", "deploy", "--stage", options.stage, "--debug"];
await runner.run_command_and_output("SLS Deploy", deployCmd, ".");
}

Expand Down
Loading

0 comments on commit fbbeacf

Please sign in to comment.