diff options
author | Zuul <zuul@review.openstack.org> | 2017-12-06 18:54:07 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-12-06 18:54:07 +0000 |
commit | 9bab764dacb9457493faf437aabe6d09dd02f679 (patch) | |
tree | a063ae2874e5dd405aeed4a8fd5313be1db9b749 /doc | |
parent | 9a43af3f3aca8adc0ba031cfb0727807deacc5e9 (diff) | |
parent | 42234421c87a09d61d99dc57be8fa985d14b439b (diff) | |
download | zuul-9bab764dacb9457493faf437aabe6d09dd02f679.tar.gz |
Merge "Convert zuul.projects to a dict" into feature/zuulv3
Diffstat (limited to 'doc')
-rw-r--r-- | doc/source/user/jobs.rst | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/doc/source/user/jobs.rst b/doc/source/user/jobs.rst index 989338a7e..ae720d882 100644 --- a/doc/source/user/jobs.rst +++ b/doc/source/user/jobs.rst @@ -220,14 +220,15 @@ of item. `src/git.example.com/org/project`. .. var:: projects - :type: list + :type: dict A list of all projects prepared by Zuul for the item. It includes, at least, the item's own project. It also includes the projects of any items this item depends on, as well as the projects that appear in :attr:`job.required-projects`. - This is a list of dictionaries, with each element consisting of: + This is a dictionary of dictionaries. Each value has a key of + the `canonical_name`, then each entry consists of: .. var:: name @@ -264,6 +265,20 @@ of item. This may be influenced by the branch or tag associated with the item as well as the job configuration. + For example, to access the source directory of a single known + project, you might use:: + + {{ zuul.projects['git.example.com/org/project'].src_dir }} + + To iterate over the project list, you might write a task + something like:: + + - name: Sample project iteration + debug: + msg: "Project {{ item.name }} is at {{ item.src_dir }} + with_items: {{ zuul.projects.values() | list }} + + .. var:: _projects :type: dict |