From f8c4bf0f1747af2ede252feb1257fa38face5697 Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Tue, 27 Aug 2019 19:56:02 +0200 Subject: [PATCH] teuthology: support github pr branches Add possibility to checkout github pr branches in format: teuthology_branch: origin/pr/*/merge Signed-off-by: Kyr Shatskyy --- roles/teuthology/tasks/setup_users.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/roles/teuthology/tasks/setup_users.yml b/roles/teuthology/tasks/setup_users.yml index f71ea881..1a9779eb 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 -- 2.47.3