Skip to content

Commit

Permalink
Dependencies in the collection packaging (#69)
Browse files Browse the repository at this point in the history
collection_readme.md - modified the wording in the Dependencies section.
collection_requirements.txt - added.
release_collection.py - added a support for {requirements,bindep}.txt.
                        removed copying collection_readme.md, which is
                        redundant.
  • Loading branch information
nhosoi authored May 6, 2021
1 parent 68e3443 commit 7d09317
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lsr_role2collection/collection_readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ NOTE: Some roles are not supported in RHEL6 and RHEL7. For more details about th

## Dependencies

The following dependency is required for the Ansible Controller:
* jmespath
If installing from RPM, the dependencies will be installed with the package.
Otherwise, the dependencies are listed in `requirements.txt` and/or `bindep.txt`.

## Installation

Expand Down
2 changes: 2 additions & 0 deletions lsr_role2collection/collection_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jmespath
netaddr
11 changes: 10 additions & 1 deletion release_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ def build_collection(src_path, dest_path, galaxy, coll_rel, force):
ignore_file_dir = os.path.join(coll_dir, "tests", "sanity")
ignore_file = os.path.join(ignore_file_dir, "ignore-2.9.txt")
collection_readme = os.path.join("lsr_role2collection", "collection_readme.md")
collection_requirements = os.path.join(
"lsr_role2collection", "collection_requirements.txt"
)
collection_requirements_dest = os.path.join(coll_dir, "requirements.txt")
collection_bindep = os.path.join("lsr_role2collection", "collection_bindep.txt")
collection_bindep_dest = os.path.join(coll_dir, "bindep.txt")
ignore_file_src = os.path.join("lsr_role2collection", "extra-ignore-2.9.txt")
ansible_lint = os.path.join("lsr_role2collection", ".ansible-lint")
for rolename, roledata in coll_rel.items():
Expand Down Expand Up @@ -102,7 +108,10 @@ def build_collection(src_path, dest_path, galaxy, coll_rel, force):
ign_fd.write(role_ign_fd.read())
shutil.copy(galaxy["_filename"], coll_dir)
shutil.copy(coll_rel["_filename"], coll_dir)
shutil.copy(collection_readme, coll_dir)
if os.path.exists(collection_requirements):
shutil.copy(collection_requirements, collection_requirements_dest)
if os.path.exists(collection_bindep):
shutil.copy(collection_bindep, collection_bindep_dest)
shutil.copy(ansible_lint, coll_dir)
with open(ignore_file, "a") as ign_fd:
with open(ignore_file_src, "r") as role_ign_fd:
Expand Down

0 comments on commit 7d09317

Please sign in to comment.