overview
overview copied to clipboard
[2d] Galaxy build ignore file - tests/output? Others from gitignore
ansible-galaxy collection build
has support for an ignore list to prevent files ending up in the built tarball.
Although ideally Collection builds should be happening in a sandbox (CI) their is still the chance that they may include incorrect files.
Also people do build and publish collections locally, where their checkouts maybe dirty.
Posisble entries
- tests/ (check ansible-base's
.gitignore
- ignore
.gitignore
Once agreed
- update collections under https://github.com/ansible-collections/
- Raise PR to update the default ignore file in https://github.com/ansible/ansible/tree/devel/lib/ansible/galaxy/data/default
I also added the collection build artifacts to build_ignore for a test collection after almost including one into the next version:
build_ignore:
- '<namespace>-<name>-*.tar.gz'
- .gitignore
I wonder if ansible-galaxy collection,role init
should add a default gitignore https://github.com/ansible/ansible/tree/devel/lib/ansible/galaxy/data/default
A default .gitignore to prevent uploading collection build tar.gz would be nice. I can see a lot of people not deleting those when they do git push after local builds, having it stop *.pyc would probably be nice too
@ericsysmin is it caused by missing entries in .gitignore
, or in build_ignore
, or both?
.gitignore would prevent people from uploading the .tar.gz to github repeatedly, build already ignores it
*.pyc would be uploaded if not in .gitignore, and not sure if the build already excludes pyc, but you do get those in git if they aren't in your .gitignore, and are created when testing python scripts, or running molecule tests
I am running ansible 2.9.6, but still getting
[WARNING]: Found unknown keys in collection galaxy.yml at '/Users/adn/workspaces/nazare/operator-collections/ims/galaxy.yml': build_ignore
build_ignore:
- yamllint.yaml
- .gitignore
- gh-pages
- dist
- run
- '*.tar.gz'
and the build still pick ups everything in the build_ignore list.
@adn1107 Ansible 2.9 does not support ignore stuff. You will need to update to at least ansible-base-2.10 or ansible-core.
@adn1107 also please note that Ansible 2.9.6 is really, really old and has security issues that were fixed a long time ago. You should really upgrade, even if just to the latest 2.9.x release.
Thanks all. Upgrading to latest Ansible solved the problem.