From: Kyr Shatskyy Date: Tue, 27 Aug 2019 17:56:02 +0000 (+0200) Subject: teuthology: support github pr branches X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f8c4bf0f1747af2ede252feb1257fa38face5697;p=ceph-cm-ansible.git teuthology: support github pr branches Add possibility to checkout github pr branches in format: teuthology_branch: origin/pr/*/merge Signed-off-by: Kyr Shatskyy --- diff --git a/roles/teuthology/tasks/setup_users.yml b/roles/teuthology/tasks/setup_users.yml index f71ea88..1a9779e 100644 --- a/roles/teuthology/tasks/setup_users.yml +++ b/roles/teuthology/tasks/setup_users.yml @@ -44,6 +44,22 @@ tags: - user +- name: Determine teuthology GitHub PR + set_fact: + teuthology_ghpr: "{{ teuthology_branch | regex_replace( '^origin/pr/([^\/]+)/.*$', '\\1') }}" + +- name: Clone the teuthology repo for GitHub PR + git: + repo: "https://github.com/ceph/teuthology" + dest: /home/{{ item }}/src/teuthology_master + version: "{{ teuthology_branch }}" + refspec: '+refs/pull/{{ teuthology_ghpr }}/*:refs/origin/pr/{{ teuthology_ghpr }}/*' + become_user: "{{ item }}" + with_items: "{{ teuthology_users }}" + tags: + - repos + when: teuthology_ghpr is defined and teuthology_ghpr != teuthology_branch + - name: Clone the teuthology repo git: repo: "{{ teuthology_repo }}" @@ -53,6 +69,7 @@ with_items: "{{ teuthology_users }}" tags: - repos + when: teuthology_ghpr is not defined or teuthology_ghpr == teuthology_branch - name: Run bootstrap shell: NO_CLOBBER=true ./bootstrap