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

No .git directory in source dir #457

Closed
leiblix opened this issue Apr 5, 2016 · 7 comments
Closed

No .git directory in source dir #457

leiblix opened this issue Apr 5, 2016 · 7 comments
Assignees

Comments

@leiblix
Copy link

leiblix commented Apr 5, 2016

My assemble script expects git repo (because my gradle build calls some git commands), not only the source code (without a .git directory).

I've tried command build with param "--save-temp-dir=true"

s2i build --incremental=true --save-temp-dir=true https://github.com/MartinRumanek/kramerius.git kramerius-builder kramerius 

and the path /tmp/s2i269878825/upload/src is ok (with .git directory), but inside the builder image directory .git doesn't exist.

$ s2i version
s2i v1.0.5-55-gfb6df26
@bparees
Copy link
Contributor

bparees commented Apr 5, 2016

yes, s2i presently explicitly excludes the .git directory. This has come up a couple times (not sure if we have another issue open for it @mfojtik @gabemontero ?)

I think we should do one of two things:

  1. add a flag to disable this behavior
  2. update the .s2iignore logic to operate as an override: if you have a .s2iignore file, then we only ignore things in that file and do not do the default "ignore .git" behavior.

I think (1) is my preference.

@mfojtik
Copy link
Contributor

mfojtik commented Apr 5, 2016

@bparees +1 for 1)

@gabemontero
Copy link
Contributor

To the historical angle @bparees alluded to, the closest thing to this that I worked was #367, where we added the force copy option to preserve empty directories.

I haven't tried it yet, but It is conceivable that could prove to be a workaround for preserving the .git directory as well (with of course requiring that you clone the repo before running s2i and pass the resulting local directory as your source destination).

I'll see where the exclusion of .git occurs in the code and/or attempt it myself, unless @MartinRumanek or someone beats me to trying it.

Based on the results, let's revisit whether we still want to do (1).

@bparees
Copy link
Contributor

bparees commented Apr 5, 2016

I'll see where the exclusion of .git occurs in the code and/or attempt it myself, unless @MartinRumanek or someone beats me to trying it.

the exclusion logic happens during the tarring for sending into the container, so i'm 99% confident it'll take effect regardless of the copy/clone strategy.

@gabemontero
Copy link
Contributor

ok thx for the quick intel @bparees - i'll start on the new option

@gabemontero
Copy link
Contributor

In looking at the code, there is already a setter for the regular expression used to exclude files, where the default regex covers the .git's.

So I'm thinking the new flag should be a bit more generic, and simple expose the regexp used for tar filtering, where the user can set it to an empty string in order to allow anything (including the .git's), or filter additional files besides .git, etc.

Thoughts?

@bparees
Copy link
Contributor

bparees commented Apr 5, 2016

sounds reasonable to me.

cgwalters added a commit to coreos/coreos-assembler that referenced this issue Aug 30, 2018
See e.g. openshift/source-to-image#457

Thankfully, OpenShift *will* do a recursive clone, so we don't
need to handle that.

Closes: #27
cgwalters added a commit to coreos/coreos-assembler that referenced this issue Aug 30, 2018
See e.g. openshift/source-to-image#457

Thankfully, OpenShift *will* do a recursive clone, so we don't
need to handle that.

Closes: #27
cgwalters added a commit to coreos/coreos-assembler that referenced this issue Aug 30, 2018
See e.g. openshift/source-to-image#457

Thankfully, OpenShift *will* do a recursive clone, so we don't
need to handle that.

Closes: #27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants