-
Notifications
You must be signed in to change notification settings - Fork 293
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
Support serverless.yml and serverless.yaml in getBindPath() #213
Conversation
This should fix the issue reported by @mrpgraae in serverless#210. I've also added support for `SLS_DEBUG` so we can more easily get some information on future errors.
return 'serverless.yml'; | ||
} | ||
if (fse.pathExistsSync(path.join(servicePath, 'serverless.yaml'))) { | ||
return 'serverless.yaml'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did serverless drop support for serverless.json
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not aware that's an option. Let me add that.
lib/docker.js
Outdated
]; | ||
try { | ||
const ps = dockerCommand(options); | ||
return ps.stdout.trim() === '/test/serverless.yml'; | ||
if (process.env.SLS_DEBUG) { | ||
console.log(`Trying bindPath ${bindPath} (${options})`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use the serverless logging facility instead of console.log
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can get to it later this week. We should consider passing this
as the second argument to .map()
in installAllRequirements()
to make this simpler and so we don't have to pass this.serverless
around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that idea! Get to it when you get to it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It ended up being a bigger surgery than I expected as we don't always call these functions with .map()
and so this
in that case is the global context. We might have to create a class to make this
make sense there.
use `X.map(..., this)` to reduce passing around of `this`
I suggest this is squash merged since I had to go back and forth between solutions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks for the updates @kichik. I'll definitely squash 👍
This should fix the issue reported by @mrpgraae in #210.
I've also added support for
SLS_DEBUG
so we can more easily get some information on future errors.