Skip to content
This repository has been archived by the owner on Mar 21, 2018. It is now read-only.

Not respecting chefignore? #151

Closed
ivey opened this issue May 30, 2013 · 5 comments · Fixed by #192
Closed

Not respecting chefignore? #151

ivey opened this issue May 30, 2013 · 5 comments · Fixed by #192

Comments

@ivey
Copy link
Contributor

ivey commented May 30, 2013

berkshelf/berkshelf#587 indicates chefignore isn't being respected, and we call straight to ridley for upload.

@sethvargo
Copy link
Contributor

Okay. I traced this down. We actually are respecting chefignores. The problem is that File.fnmatch is getting passed the entire filepath (expanded path). In short:

File.fnmatch?("README.md", "README.md") #=> true
File.fnmatch?("README.md", "/Users/sethvargo/cookbooks/foo/README.md") #=> false

So we'll need to generate the relative pathnames and then apply File#fnmatch. I'm working on this now.

@iroller
Copy link
Contributor

iroller commented Mar 20, 2014

Just updated to 2.0.14:

  • berkshelf (2.0.14)
  • ridley (1.5.3)

And it looks like chefignore is being ignored again:

mycookbook $ bundle list | grep -E 'ridley|berkshelf'
  * berkshelf (2.0.14)
  * ridley (1.5.3)

Uploading with chef works fine:

mycookbook $ knife cookbook upload mycookbook -o ../
Uploading mycookbook   [0.1.23]
Uploaded 1 cookbook.

mycookbook $ knife diff
mycookbook $ 

Uploading with berks/ridley ingores chefignore:

mycookbook $ bundle exec berks upload --no-freeze
Uploading mycookbook (0.1.23) to: 'chef-server'
...

mycookbook $  knife diff --name-only
.gitignore
Berksfile
CHANGELOG.md

mycookbook $ grep -Ei 'gitignore|berksfile|changelog' chefignore
.gitignore
Berksfile
Berksfile.lock
CHANGELOG*

@sethvargo
Copy link
Contributor

What about on the master branch?

@iroller
Copy link
Contributor

iroller commented Mar 20, 2014

Not using berkshelf 3.0 for uploading cookbooks, needs a bunch of work to get it rolled everywhere. Stable berkshelf 2.0 is still doing a bunch of work here

@iroller
Copy link
Contributor

iroller commented Mar 20, 2014

@sethvargo I'll consider switching to Berkshelf 3.0 in this case if it's not a quick fix. (looks like ridley (1.5.3) should have the fix, not sure why it's not working)

@berkshelf berkshelf locked and limited conversation to collaborators Jun 16, 2017
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants