-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(lambda-nodejs): run parcel in a docker container #7842
Conversation
// Find the git root and mount it in the container. This allows Parcel to | ||
// find the same modules/dependencies as the ones available "locally". It | ||
// also supports monorepos. | ||
const projectRoot = path.dirname(findGitPath()); |
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.
@eladb this is the fix
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.
This implies that the project root is the git root which means:
- That the project directory must be inside a git repo. This is not always the case. For example, last time I checked, when you used GitHub as a source for CodePipeline, the CodeBuild project did not include a git clone but rather a copy of the source tree (without a .git directory).
- Maybe we need to allow people to configure this?
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.
Do you have maybe a suggestion to find the root of a monorepo?
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.
How about we allow people to specify it and default to searching for .git
, but if we can't find we omit an error explaining how to manually configure.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
// Find the git root and mount it in the container. This allows Parcel to | ||
// find the same modules/dependencies as the ones available "locally". It | ||
// also supports monorepos. | ||
const projectRoot = path.dirname(findGitPath()); |
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.
This implies that the project root is the git root which means:
- That the project directory must be inside a git repo. This is not always the case. For example, last time I checked, when you used GitHub as a source for CodePipeline, the CodeBuild project did not include a git clone but rather a copy of the source tree (without a .git directory).
- Maybe we need to allow people to configure this?
@@ -104,6 +118,7 @@ export class NodejsFunction extends lambda.Function { | |||
cacheDir: props.cacheDir, | |||
nodeVersion: extractVersion(runtime), | |||
nodeDockerTag: props.nodeDockerTag || `${process.versions.node}-alpine`, | |||
projectRoot: path.dirname(path.resolve(projectRoot)), |
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.
Why dirname?
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.
This is wrong... was because findGitPath()
returned the path with .git/
.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@eladb do you have/can you share usage statistics for |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Commit Message
feat(lambda-nodejs): run parcel in a docker container
Redo of #7169.
End Commit Message
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license