]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
teuthology: support github pr branches 470/head
authorKyr Shatskyy <kyrylo.shatskyy@gmail.com>
Tue, 27 Aug 2019 17:56:02 +0000 (19:56 +0200)
committerKyr Shatskyy <kyrylo.shatskyy@gmail.com>
Tue, 27 Aug 2019 19:32:09 +0000 (21:32 +0200)
Add possibility to checkout github pr branches in format:
teuthology_branch: origin/pr/*/merge

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
roles/teuthology/tasks/setup_users.yml

index f71ea88156bb8057ec1e6a0f02e77da16135d9c8..1a9779ebf5fe9b02ed8cd7538dd654ab42cf129d 100644 (file)
   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