scrapinghub / shub

Scrapinghub Command Line Client

Home Page:https://shub.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add flag on build to run the build against a clean git representation of the project

arruda opened this issue · comments

I was thinking that it would be nice to have a flag, like --clean-repo, that would make the build/deploy command use a clean version of the current git repository of the project, and use this as a base for the _build_egg (https://github.com/scrapinghub/shub/blob/master/shub/deploy.py#L190) command.

This way it would avoid deploying files that should are on .gitignore, and that aren't really part of the project itself. This could also be added in the .yml file so that one wouldn't need to pass this flag all the time.
I believe that later on this could also be extended to other CVS like Hg, but we could start by making it working with git first.

In git I believe we could do so by using git archive command to get all the necessary content of the project (maybe there some other direct route to getting this cleaned project data).

What do you people say? Is this a good idea?

Looks good to me 👍 Also we should probably warn about current repository state (is it clean or not, to prevent any questions like why local changes didn't get deployed).

From an operational standpoint, it would be better to deploy from HEAD as the default, warn when there are uncommitted changes, and provide a flag to override.