Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Add collections lock file support (Fixes #173) #271

Merged
merged 2 commits into from
May 30, 2019

Conversation

alikins
Copy link
Contributor

@alikins alikins commented May 28, 2019

SUMMARY

Add --collections-lock art to a 'collections lock'

Add support for 'collection lockfiles'.

A collections lock specifies a set of collections to install
and the version specs to match.

Fixes #173

Add collections_lock and collections_lockfile models.

Add ansible_galaxy.collections_lockfile with a yaml loader
for a collections lockfile.

Update cli and install action to use the collections lockfile.

The contents of collections lock file is a yaml file, containing a dictionary.
The dictitionary is the same format as the 'dependencies' dict in
galaxy.yml.

ie, The keys are collection labels (the namespace and name
dot separated ala 'alikins.collection_inspect').

The values is a version spec string. ie "*" or "==1.0.0".

Example contents of a collections lock file:

alikins.collection_inspect: "1.0.0"
alikins.collection_ntp: ">0.0.1,!=0.0.2"
ISSUE TYPE
  • Feature Pull Request
MAZER VERSION
name = mazer
version = 0.5.0
config_file = /home/adrian/.ansible/mazer.yml
uname = Linux, newswoop, 5.0.5-200.fc29.x86_64, #1 SMP Wed Mar 27 20:58:04 UTC 2019, x86_64
executable_location = /home/adrian/venvs/mazer_0.4.0_py36/bin/mazer
python_version = 3.6.8 (default, Jan 27 2019, 09:00:23) [GCC 8.2.1 20181215 (Red Hat 8.2.1-6)]
python_executable = /home/adrian/venvs/mazer_0.4.0_py36/bin/python

Move convert_none_to_empty_dict() and convert_single_to_list()
from models/collection_info.py to utils/attr_utils.py so
other modules can use them.
@alikins alikins added this to the Mazer 1.0.0 milestone May 28, 2019
@alikins alikins force-pushed the lockfile_173 branch 3 times, most recently from 2d41d04 to 78b3c51 Compare May 28, 2019 18:45
@alikins alikins changed the title [WIP] Add collections lock file support (Fixes #173) Add collections lock file support (Fixes #173) May 28, 2019
@alikins alikins requested a review from chouseknecht May 28, 2019 18:46
Add support for 'collection lockfiles'.
Add 'list --lockfile' to output a collections lockfile to stdout.

A collections lock specifies a set of collections to install
and the version specs to match.

Fixes ansible#173

Add collections_lock and collections_lockfile models.

Add ansible_galaxy.collections_lockfile with a yaml loader
for a collections lockfile.

Update cli and install action to use the collections lockfile.

Update README.md with lockfile info

To reproduce an existing installed collection path, use like:

  mazer list --lockfile  > collections_lockfile.yml
  mazer install --collections-path /tmp/somenewplace --collections-lock collections_lockfile.yml

To create a lockfile that matches current versions exactly, add
the '--frozen' flag:

  mazer list --lockfile --frozen

Example output for `mazer list --lockfile`:

alikins.collection_inspect: '*'
example.foobar: '*'

Example output for `mazer list --lockfile --frozen`:

alikins.collection_inspect: ==1.2.3
example.foobar: ==0.0.9

The contents of  collections lock file is a yaml file,
containing a dictionary. The dictitionary is the same
format as the 'dependencies' dict in galaxy.yml.

ie, The keys are collection labels (the namespace and name
dot separated ala 'alikins.collection_inspect').

The values is a version spec string. ie "*" or "==1.0.0".

Example contents of a collections lock file:

alikins.collection_inspect: "1.0.0"
alikins.collection_ntp: ">0.0.1,!=0.0.2"
@alikins alikins merged commit be85287 into ansible:devel May 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lockfile Support
1 participant