Skip to content

Commit

Permalink
Add checkout to PR banch into e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud>
  • Loading branch information
michal-gubricky committed Jul 22, 2024
1 parent a516c90 commit 2850215
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions playbooks/openstack/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@
tasks:
- name: Determine cluster stack directory
block:
- name: |
Set facts -
Priority is given to the values of git_reference and git_repo over variables collected from the PR.
In cases where git_reference and git_repo are undefined, and e2e is not executed on the PR, a fallback mechanism is employed.
ansible.builtin.set_fact:
git_branch_name: "{{ git_reference | default(pull_request.json.head.ref) | default(git_reference_default) }}"
git_repository_url: "{{ git_repo | default(pull_request.json.head.repo.clone_url) | default(git_repo_default) }}"
- name: Checkout to PR branch
ansible.builtin.git:
repo: "{{ git_repository_url }}"
clone: false
dest: "{{ project_dir }}"
version: "{{ git_branch_name }}"
when: zuul.change is defined # execute when the e2e pipeline is initiated on a PR
- name: Make sure directory structure exists
ansible.builtin.file:
path: "{{ item }}"
Expand Down

0 comments on commit 2850215

Please sign in to comment.