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

Support serverless.yml and serverless.yaml in getBindPath() #213

Merged
merged 8 commits into from
Jul 16, 2018

Conversation

kichik
Copy link
Contributor

@kichik kichik commented Jul 3, 2018

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.

kichik added 2 commits July 3, 2018 08:11
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';
Copy link
Contributor

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?

Copy link
Contributor Author

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})`)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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 👍

Copy link
Contributor Author

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.

@kichik
Copy link
Contributor Author

kichik commented Jul 14, 2018

I suggest this is squash merged since I had to go back and forth between solutions.

Copy link
Contributor

@dschep dschep left a 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 👍

@dschep dschep merged commit fa12ab4 into serverless:master Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants