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

Do not include the .git directory in module packages #540

Merged
merged 2 commits into from
Feb 22, 2021

Conversation

smortex
Copy link
Contributor

@smortex smortex commented Feb 12, 2021

The package of the puppet_agent module on the Puppet Forge contains the
.git directory with the whole history of the project.

This content is not used by Puppet and only makes the package bigger and
longuer to deploy using r10k, so add a .pdkignore file (stolen from the
puppetlabs-motd module) which list the .git directory along with some
more files to be ignored.

Note since I am not 100% sure about the way this module is packaged, some adjustments might be required. Feel free to ask for them and I will happily amend this PR to adjust it.

@smortex smortex requested a review from a team February 12, 2021 17:46
@smortex smortex force-pushed the pdkignore branch 2 times, most recently from 02942af to 9c8fcb1 Compare February 12, 2021 17:50
@GabrielNagy
Copy link
Contributor

Ahh, so this is why I had the entire git history whenever I installed and debugged this module 😄.

I would also add these paths to be ignored:

  • acceptance/
  • docker/
  • .github/
  • .rubocop_todo.yml

I'll also run some tests on our internal CI to ensure we don't break something by accident.

The package of the puppet_agent module on the Puppet Forge contains the
.git directory with the whole history of the project.

This content is not used by Puppet and only makes the package bigger and
longuer to deploy using r10k, so add a .pdkignore file (stolen from the
puppetlabs-motd module) which list the .git directory along with some
more files to be ignored.
@smortex
Copy link
Contributor Author

smortex commented Feb 22, 2021

@GabrielNagy Extra paths added and branch rebased on top of main.

@GabrielNagy
Copy link
Contributor

Looks good @smortex, forgot to include task_spec/ which can also be ignored when packaging the module.

Copy link
Contributor

@GabrielNagy GabrielNagy left a comment

Choose a reason for hiding this comment

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

File list after exclusions:

drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0
-rw-r--r-- 1000/1000     26201 2021-02-04 16:46 puppetlabs-puppet_agent-4.4.0/CHANGELOG.md
-rw-r--r-- 1000/1000       116 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/CODEOWNERS
-rw-r--r-- 1000/1000      3231 2021-02-04 16:46 puppetlabs-puppet_agent-4.4.0/CODE_OF_CONDUCT.md
-rw-r--r-- 1000/1000      4850 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/CONTRIBUTING.md
-rw-r--r-- 1000/1000      8389 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/DEVELOPERS.md
-rw-r--r-- 1000/1000     11358 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/LICENSE
-rw-r--r-- 1000/1000       593 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/NOTICE
-rw-r--r-- 1000/1000     18761 2020-12-08 10:24 puppetlabs-puppet_agent-4.4.0/README.markdown
-rw-r--r-- 1000/1000        79 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/bolt_plugin.json
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/examples
-rw-r--r-- 1000/1000       516 2019-06-20 14:53 puppetlabs-puppet_agent-4.4.0/examples/init.pp
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/files
-rw-r--r-- 1000/1000         0 2019-06-20 14:53 puppetlabs-puppet_agent-4.4.0/files/.gitkeep
-rw-r--r-- 1000/1000      1676 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/files/GPG-KEY-puppet
-rw-r--r-- 1000/1000      1710 2021-02-18 16:31 puppetlabs-puppet_agent-4.4.0/files/GPG-KEY-puppet-20250406
-rw-r--r-- 1000/1000       400 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/files/helpers.ps1
-rw-r--r-- 1000/1000     13974 2020-10-30 12:49 puppetlabs-puppet_agent-4.4.0/files/install_puppet.ps1
-rw-r--r-- 1000/1000      2611 2020-10-30 12:49 puppetlabs-puppet_agent-4.4.0/files/prerequisites_check.ps1
-rw-r--r-- 1000/1000       241 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/files/solaris_start_puppet.sh
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/lib
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/lib/facter
-rw-r--r-- 1000/1000       107 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/lib/facter/env_temp_variable.rb
-rw-r--r-- 1000/1000      1162 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/lib/facter/mco_config.rb
-rw-r--r-- 1000/1000       273 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/lib/facter/puppet_agent_appdata.rb
-rw-r--r-- 1000/1000        63 2019-06-20 14:53 puppetlabs-puppet_agent-4.4.0/lib/facter/puppet_agent_pid.rb
-rw-r--r-- 1000/1000      1478 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/lib/facter/settings.rb
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/lib/puppet
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/lib/puppet/functions
-rw-r--r-- 1000/1000       941 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/lib/puppet/functions/any_resources_of_type.rb
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/lib/puppet/parser
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/lib/puppet/parser/functions
-rw-r--r-- 1000/1000       241 2019-06-20 14:53 puppetlabs-puppet_agent-4.4.0/lib/puppet/parser/functions/uri_host_from_string.rb
-rw-r--r-- 1000/1000       813 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/lib/puppet/parser/functions/windows_msi_installargs.rb
-rw-r--r-- 1000/1000       247 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/lib/puppet/parser/functions/windows_native_path.rb
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/lib/puppet/provider
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/lib/puppet/provider/puppet_agent_end_run
-rw-r--r-- 1000/1000       902 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/lib/puppet/provider/puppet_agent_end_run/puppet_agent_end_run.rb
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/lib/puppet/provider/puppet_agent_upgrade_error
-rw-r--r-- 1000/1000      1038 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/lib/puppet/provider/puppet_agent_upgrade_error/puppet_agent_upgrade_error.rb
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/lib/puppet/type
-rw-r--r-- 1000/1000       810 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/lib/puppet/type/puppet_agent_end_run.rb
-rw-r--r-- 1000/1000       751 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/lib/puppet/type/puppet_agent_upgrade_error.rb
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/locales
-rw-r--r-- 1000/1000      1072 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/locales/config.yaml
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/manifests
-rw-r--r-- 1000/1000     10372 2020-10-29 11:55 puppetlabs-puppet_agent-4.4.0/manifests/init.pp
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/manifests/install
-rw-r--r-- 1000/1000       704 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/manifests/install/darwin.pp
-rw-r--r-- 1000/1000      2376 2020-12-08 10:24 puppetlabs-puppet_agent-4.4.0/manifests/install/solaris.pp
-rw-r--r-- 1000/1000      5183 2021-02-18 16:31 puppetlabs-puppet_agent-4.4.0/manifests/install/windows.pp
-rw-r--r-- 1000/1000      4001 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/manifests/install.pp
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/manifests/osfamily
-rw-r--r-- 1000/1000      2807 2020-12-14 14:47 puppetlabs-puppet_agent-4.4.0/manifests/osfamily/aix.pp
-rw-r--r-- 1000/1000      1389 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/manifests/osfamily/darwin.pp
-rw-r--r-- 1000/1000      4708 2021-01-19 17:33 puppetlabs-puppet_agent-4.4.0/manifests/osfamily/debian.pp
-rw-r--r-- 1000/1000      5931 2021-01-19 17:33 puppetlabs-puppet_agent-4.4.0/manifests/osfamily/redhat.pp
-rw-r--r-- 1000/1000      4925 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/manifests/osfamily/solaris.pp
-rw-r--r-- 1000/1000      5222 2021-01-19 17:33 puppetlabs-puppet_agent-4.4.0/manifests/osfamily/suse.pp
-rw-r--r-- 1000/1000      1441 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/manifests/osfamily/windows.pp
-rw-r--r-- 1000/1000      2798 2021-01-13 14:53 puppetlabs-puppet_agent-4.4.0/manifests/params.pp
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/manifests/prepare
-rw-r--r-- 1000/1000      1580 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/manifests/prepare/package.pp
-rw-r--r-- 1000/1000      1293 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/manifests/prepare/puppet_config.pp
-rw-r--r-- 1000/1000      1379 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/manifests/prepare.pp
-rw-r--r-- 1000/1000      1838 2020-12-08 10:24 puppetlabs-puppet_agent-4.4.0/manifests/service.pp
-rw-r--r-- 1000/1000      2625 2021-02-04 16:46 puppetlabs-puppet_agent-4.4.0/metadata.json
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/plans
-rw-r--r-- 1000/1000      2242 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/plans/run.pp
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/tasks
-rw-r--r-- 1000/1000      1873 2021-02-18 16:31 puppetlabs-puppet_agent-4.4.0/tasks/install.json
-rw-r--r-- 1000/1000      1619 2021-02-18 16:31 puppetlabs-puppet_agent-4.4.0/tasks/install_powershell.json
-rw-r--r-- 1000/1000      4862 2021-02-18 16:31 puppetlabs-puppet_agent-4.4.0/tasks/install_powershell.ps1
-rw-r--r-- 1000/1000      1688 2021-02-18 16:31 puppetlabs-puppet_agent-4.4.0/tasks/install_shell.json
-rw-r--r-- 1000/1000     17650 2021-02-18 16:31 puppetlabs-puppet_agent-4.4.0/tasks/install_shell.sh
-rw-r--r-- 1000/1000       142 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/tasks/run.json
-rw-r--r-- 1000/1000      9036 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/tasks/run.rb
-rw-r--r-- 1000/1000       322 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/tasks/version.json
-rw-r--r-- 1000/1000       150 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/tasks/version_powershell.json
-rw-r--r-- 1000/1000       575 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/tasks/version_powershell.ps1
-rw-r--r-- 1000/1000       183 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/tasks/version_shell.json
-rw-r--r-- 1000/1000       177 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/tasks/version_shell.sh
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/templates
-rw-r--r-- 1000/1000         0 2019-06-20 14:53 puppetlabs-puppet_agent-4.4.0/templates/.gitkeep
-rw-r--r-- 1000/1000       446 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/templates/do_install.sh.erb
-rw-r--r-- 1000/1000       409 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/templates/osx_install.sh.erb
-rw-r--r-- 1000/1000       995 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/templates/solaris_install.sh.erb
drwxr-xr-x 1000/1000         0 2021-02-22 19:18 puppetlabs-puppet_agent-4.4.0/types
-rw-r--r-- 1000/1000       157 2020-10-28 10:57 puppetlabs-puppet_agent-4.4.0/types/arch.pp

Looks good to me! 👍

Also, archive size went down from > 2M to ~64K, which is nice!

@GabrielNagy GabrielNagy merged commit f5f3a0b into puppetlabs:main Feb 22, 2021
@smortex smortex deleted the pdkignore branch February 22, 2021 17:43
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