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 #280: support docker lambdas #291

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion src/Serverless.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ declare namespace Serverless {
}

interface Function {
handler: string
handler?: string
package: Serverless.Package
runtime?: string
image?: Serverless.Image
}

interface Image {
name: string
}
interface Layer {
handler: string
package: Serverless.Package
Expand Down
3 changes: 2 additions & 1 deletion src/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export function extractFileNames(cwd: string, provider: string, functions?: { [k

return _.values(functions)
.map(fn => fn.handler)
.filter(Boolean)
.map(h => {
const fnName = _.last(h.split('.'))
const fnNameLastAppearanceIndex = h.lastIndexOf(fnName)
Expand Down Expand Up @@ -169,4 +170,4 @@ export function getTypescriptCompileFiles(
return configParseResult.fileNames.map(f => f.replace(cwd + '/', ''))
}
return []
}
}
10 changes: 10 additions & 0 deletions tests/typescript.extractFileName.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ const functions: { [key: string]: Serverless.Function } = {
patterns: []
}
},
dockerBasedFunction: {
image: {
name: 'path/to/lambda/image'
},
package: {
include: [],
exclude: [],
patterns: []
}
}
}

describe('extractFileName', () => {
Expand Down