Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: lamda build and add license #248

Merged
merged 1 commit into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions DISCLAIMER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
We’ve made our Foundations’ roadmap public on GitHub to outline Reapit’s current product plans for its developer platform and marketplace.

All information is provided for INFORMATIONAL PURPOSES ONLY, is general in nature, and should not be relied upon or construed as a binding commitment to deliver any material, code, or functionality. Reapit makes no guarantees of any kind regarding the information herein.

Please do not rely on this information in making decisions, as the development, release and timing of any products, features or functionality shall be made in Reapit’s sole discretion, and is subject to change.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ This is the repository for the Reapit Foundations API, Marketplace, cloud applic
* If you want to request a feature, please open an issue [here](https://github.com/reapit/foundations/issues/new?labels=feature-request&projects=reapit/foundations/3&body=Summary%20of%20Request:%0d%0dExpected%20Behaviour). If it is accepted for development, you can track it's progress on our [features board](https://github.com/reapit/foundations/projects/3).
* If you wish to report a bug, again please [raise an issue](https://github.com/reapit/foundations/issues/new?labels=bug&projects=reapit/foundations/2&body=Summary:%0d%0dSteps%20to%20reproduce:%0d%0dExpected%20Results:%0d%0dActual%20Results). You can track it [here](https://github.com/reapit/foundations/projects/2) as our engineers look into it.
* If you are interested in our future roadmap, you can see our [project milestones here](https://github.com/reapit/foundations/milestones?direction=asc&sort=due_date&state=open).

Please read our [license](./LICENSE.md) and [disclaimer](./DISCLAIMER.md) before proceeding.
2 changes: 1 addition & 1 deletion packages/cognito-custom-mail-lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test:ci": "cross-env TZ=UTC jest --ci --colors --coverage --silent --forceExit",
"test:dev": "cross-env TZ=UTC jest --watch --verbose",
"build:prod": "rimraf dist && tsc --p tsconfig.json && cp -rf ./src/mailer/templates/ejs ./dist/mailer/templates/ejs",
"release:dev": "cross-env CI=true serverless deploy --stage DEV",
"release:dev": "cross-env CI=true serverless deploy --stage dev",
"release:prod": "node ../../scripts/release/release-serverless.js cognito-custom-mail-lambda",
"test:update-badges": "yarn test:ci && jest-coverage-badges --input src/tests/coverage/coverage-summary.json --output src/tests/badges"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/cognito-custom-mail-lambda/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ custom: ${file(../../reapit-config.json)}
provider:
name: aws
runtime: nodejs10.x
stage: ${opt:stage, 'DEV'}
stage: ${opt:stage, 'dev'}
region: eu-west-2
deploymentBucket:
name: cognito.mailer.${self:provider.stage}
blockPublicAccess: false
environment:
COGNITO_USERPOOL_ID: ${self:custom.${self:provider.stage}.COGNITO_USERPOOL_ID}
MARKET_PLACE_URL: ${self:custom.${self:provider.stage}.MARKET_PLACE_URL}
COGNITO_USERPOOL_ID: ${self:custom.${file(./yml-helpers.js):provider.stage.uppercase}.COGNITO_USERPOOL_ID}
MARKET_PLACE_URL: ${self:custom.${file(./yml-helpers.js):provider.stage.uppercase}.MARKET_PLACE_URL}
package:
include:
- dist/**
Expand All @@ -37,6 +37,6 @@ functions:
handler: dist/app.cognitoCustomMailerHandler
events:
- cognitoUserPool:
pool: ${self:custom.${self:provider.stage}.COGNITO_USERPOOL_ID}
pool: ${self:custom.${file(./yml-helpers.js):provider.stage.uppercase}.COGNITO_USERPOOL_ID}
trigger: CustomMessage
existing: true
19 changes: 19 additions & 0 deletions packages/cognito-custom-mail-lambda/yml-helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// https://stackoverflow.com/questions/48226686/serverless-yml-touppercase#48249468
module.exports.provider = serverless => {
// The `serverless` argument containers all the information in the .yml file
const provider = serverless.service.provider

return Object.entries(provider).reduce(
(accumulator, [key, value]) => ({
...accumulator,
[key]:
typeof value === 'string'
? {
lowercase: value.toLowerCase(),
uppercase: value.toUpperCase(),
}
: value,
}),
{},
)
}
2 changes: 1 addition & 1 deletion scripts/release/release-serverless.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const releaseServerless = async () => {
}

if (packageName === packageNameOnTag) {
execSync('cross-env CI=true serverless deploy --stage PROD')
execSync('cross-env CI=true serverless deploy --stage prod')
const previousTag = getPreviousTag({ packageName: packageNameOnTag })

await editReleaseNote({ packageName: packageNameOnTag, version, previousTag })
Expand Down