-
Notifications
You must be signed in to change notification settings - Fork 152
feat: builds for Go files in a different directory #406
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
Conversation
mildaniel
left a comment
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.
Great work! Looks good overall. I left a few nit-picky comments and a question.
Can we also just add an integration test case which covers the customer's specific use-case to make sure we don't do anything to break that in the future.
|
Thanks @Harleenijjar for the contribution. so, when customer executes so I think using the Handler as a location to run I think the solution is we need the customer to provide a base directory to be mounted to the container, and then we can normally run the |
moelasmar
left a comment
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 left my comment in the conversation
mndeveci
left a comment
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.
Thanks for the PR!
I would recommend running make pr to find the errors for the CI jobs that is failing now.
|
This PR also addresses this issue: aws/aws-sam-cli#2844 |
mildaniel
left a comment
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.
Thanks for the updates!
Earlier concerns have been addressed by @Harleenijjar
Issue #, if available:
Bug: sam build --use-container doesn't correctly build golang containers #3894
Unable to build go files using --use-container when go files are in different directory than the main file because it only mounts one directory which is the codeUri to the docker container. This implies that only the files in that directory are found when using a container. Works for non container builds because no mounting is required.
Description of changes:
Added a method to build go files while using a container when go files are in a different directory than the main files. Method is called when sam build is unable to find the files which will imply that the files are in a different directory. It will run this method and be able to find the main.go files.Therefore, Mounting the parent directory with all the files. This implies the CodeUri must be the parent directory and handler must be the path to the main.go file. This way the build command will be able to find the go files in the parent directory plus follow the path to the main.go file.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.