From 56a4eb8adecfe005f6c31c6ebe00a91ecf297bae Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Tue, 31 Oct 2017 09:38:55 +0000 Subject: [PATCH] Ensure all pre-cloned git sources are found Currently the find task only looks at one level deep for repo folders, instead of the required three levels deep. Using the find module does not give us the ability to set the depth level we want to do the find down to, so we use a find command instead. Change-Id: I0b218fe276292e13dbb40ab38c9a167025d16e45 --- test-repo-setup.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/test-repo-setup.yml b/test-repo-setup.yml index fbdc5ca5..bb77d60f 100644 --- a/test-repo-setup.yml +++ b/test-repo-setup.yml @@ -23,20 +23,32 @@ file: state: directory path: "{{ development_repo_directory }}" + + # Git clones for developer testing are expected to be in the + # following structure, which mirrors how zuul v3 implements + # the clones: + # + # /src// + # + # eg: /home/zuul/src/git.openstack.org/keystone + # /home/zuul/src/github.com/projectcalico/felix + # - name: Check for repositories that are cloned in the repos directory - find: - paths: "{{ development_repo_directory }}/" - file_type: directory + command: "find {{ development_repo_directory }} -maxdepth 3 -mindepth 3 -type d" register: projects_directory_find + tags: + - skip_ansible_lint + + # For the constraint file we assume that the egg name + # matches the repo folder name. - name: Set var for git install branch copy: dest: "{{ development_repo_directory }}/local-package-constraints-{{ test_branch | replace('/','_') }}.txt" content: | ## Ansible Managed - {% if projects_directory_find.files is defined %} - {% for project in projects_directory_find.files %} - file://{{ project.path }}#egg={{ project.path.split("/")[-1] }} + {% for folder_path in projects_directory_find.stdout_lines %} + file://{{ folder_path }}#egg={{ folder_path.split("/")[-1] }} {% endfor %} - {% endif %} + vars_files: - test-vars.yml