Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Task to manage chefignore file #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Task to manage chefignore file #90

wants to merge 1 commit into from

Conversation

athompson-r7
Copy link
Contributor

The aim of this change is to try to detect the presence of the ignore
files/directores in the chefignore file and try to add them if they
are missing.

In addition to adding the ignore files to the chefignore file we are
displaying a warning to the user suggesting they update their
chefignore file in the source repo so we don't have to do this.

Finally, we copy the chefignore file to the .builderator so that the
berks binary can find and use it.

The content we are adding looks like this:

.builderator

We are no longer nesting vendored cookbooks, so this fixes #88.

$ find .builderator -name rapid7-logstash-server

$ find .builderator/cookbooks | wc -l
     813

The aim of this change is to try to detect the presence of the ignore
files/directores in the `chefignore` file and try to add them if they
are missing.

In addition to adding the ignore files to the `chefignore` file we are
displaying a warning to the user suggesting they update their
`chefignore` file in the source repo so we don't have to do this.

Finally, we copy the `chefignore` file to the `.builderator` so that the
`berks` binary can find and use it.

The content we are adding looks like this:

```
.builderator
```

We are no longer nesting vendored cookbooks, so this fixes #88.

```
$ find .builderator -name rapid7-logstash-server

$ find .builderator/cookbooks | wc -l
     813
```
@dgreene-r7
Copy link
Contributor

Looks good! 👍

@@ -23,6 +23,26 @@ def configure
Interface.berkshelf.write
end

desc 'chefignore', 'Create or Update chefignore to ignore .builderator directory'
def chefignore
ignore_file_list = ['.builderator']
Copy link
Contributor

Choose a reason for hiding this comment

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

@athompson-r7 how about making this a method_option (--ignore-files) and defaulting to [".builderator"]?

ignore_file = ::File.readlines(ignore)
ignore_file.map! { |i| i.chomp }
files = ignore_file_list.all? { |i| ignore_file.include?(i) }
unless files
Copy link
Contributor

Choose a reason for hiding this comment

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

How about unless all_files_ignored instead?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cookbook vendoring causing Errno::ENAMETOOLONG
3 participants