Skip to content
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ $ node-lambda deploy --help
-D, --prebuiltDirectory [] Prebuilt directory
-z, --deployZipfile [] Deploy zipfile
-T, --deployTimeout [120000] Deploy Timeout
-G, --sourceDirectory [.] Path to lambda source Directory (e.g. "./some-lambda")
```

## Custom Environment Variables
Expand Down
2 changes: 2 additions & 0 deletions bin/node-lambda
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ var EVENT_FILE = process.env.EVENT_FILE || 'event.json';
var PACKAGE_DIRECTORY = process.env.PACKAGE_DIRECTORY;
var CONTEXT_FILE = process.env.CONTEXT_FILE || 'context.json';
var PREBUILT_DIRECTORY = process.env.PREBUILT_DIRECTORY || '';
var SRC_DIRECTORY = process.env.SRC_DIRECTORY || '';
var DEPLOY_TIMEOUT = process.env.DEPLOY_TIMEOUT || 120000;
var DOCKER_IMAGE = process.env.DOCKER_IMAGE || '';
var DEPLOY_ZIPFILE = process.env.DEPLOY_ZIPFILE || '';
Expand Down Expand Up @@ -110,6 +111,7 @@ program
.option('-T, --tracingConfig [' + AWS_TRACING_CONFIG + ']', 'Lambda tracing settings',
AWS_TRACING_CONFIG)
.option('-A, --packageDirectory [' + PACKAGE_DIRECTORY + ']', 'Local Package Directory', PACKAGE_DIRECTORY)
.option('-G, --sourceDirectory [' + SRC_DIRECTORY + ']', 'Path to lambda source Directory (e.g. "./some-lambda")', SRC_DIRECTORY)
.option('-I, --dockerImage [' + DOCKER_IMAGE + ']', 'Docker image for npm install', DOCKER_IMAGE)
.option('-f, --configFile [' + CONFIG_FILE + ']',
'Path to file holding secret environment variables (e.g. "deploy.env")', CONFIG_FILE)
Expand Down
3 changes: 2 additions & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ Lambda.prototype._buildAndArchive = function (program, archive_callback) {

var _this = this;
var codeDirectory = _this._codeDirectory(program);
var lambdaSrcDirectory = program.sourceDirectory ? program.sourceDirectory.replace(/\/$/, '') : '.';

_this._cleanDirectory(codeDirectory, function (err) {
if (err) {
Expand All @@ -528,7 +529,7 @@ Lambda.prototype._buildAndArchive = function (program, archive_callback) {
copyFunction = '_rsync';
}
// Move files to tmp folder
_this[copyFunction](program, '.', codeDirectory, true, function (err) {
_this[copyFunction](program, lambdaSrcDirectory, codeDirectory, true, function (err) {
if (err) {
return archive_callback(err);
}
Expand Down