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

[infra] Prevent mounting local checkout to $SRC + clean up Dockerfiles (#1699). #1700

Merged
merged 1 commit into from
Aug 9, 2018

Conversation

Dor1s
Copy link
Contributor

@Dor1s Dor1s commented Aug 9, 2018

No description provided.

@Dor1s Dor1s requested a review from oliverchang August 9, 2018 19:29
@Dor1s
Copy link
Contributor Author

Dor1s commented Aug 9, 2018

Seems to work locally, so I'm landing for now. Oliver, please take a look whether you're fine with this change.

@Dor1s Dor1s merged commit 8d3e462 into master Aug 9, 2018
@Dor1s Dor1s deleted the workdir branch August 9, 2018 19:31
Copy link
Collaborator

@oliverchang oliverchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, just one comment.

WORKDIR_REGEX = re.compile(r'\s*WORKDIR\s*([^\s]+)')
def _workdir_from_dockerfile(project_name):
"""Parse WORKDIR from the Dockerfile for the given project."""
WORKDIR_REGEX = re.compile(r'\s*WORKDIR\s*(\$SRC/[^\s]+)')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the addition of $SRC needed in the regex? There are lots of Dockerfiles without $SRC in their WORKDIR command.

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 thought it would be an elegant way to avoid WORKDIR $SRC cases, but you're right, I also avoid WORKDIR project now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example this is wrong:

>>> import helper
>>> helper._workdir_from_dockerfile('firefox')
'/src/firefox'
Should be:
'/src/mozilla-central'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah :( let me upload another fix.

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