Version Tags
# the repository must be clean before running 'npm version'
git add *
git commit -m "your message"
# upgrade the package version and git tag
# use 'patch' for fixes; 'minor' for compatible changes; 'major' for incompatible changes
npm version patch
The above scripts will install the dependencies and will create a ZIP package in the dist folder, which will contain all connector triggers, actions, and methods.
Deployment Script
If you have created your connector using the cn-example-lambda, you already have scrips for your lambda function deployments. Otherwise you can download them from the scripts folder of the cn-example-lambda repository:
- scripts/push.sh - uploads deployment package to AWS and creates a new function version
- scripts/promote.sh - switches the uploaded and tested function to production
# aws cli must be configured once to use the Apination AWS account
# you'll be interactively asked for your access keys
aws configure
# push the build pacakge to AWS
./scripts/push.sh cn_example_get_some_updates
The push.sh script will update the $LATEST version of the lambda function and will create an immutable version of the function, using git version tag as a description.
When the deployed function is tested locally or on staging, it can be tagged as PROD, which will mark it for use by the production server. To do that, run ./scripts/promote.sh with your function name and Lambda function version as a parameter (Lambda function version was returned from script execution on the previous step):
./scripts/promote.sh cn_example_get_some_updates 3