41 lines
1.6 KiB
YAML
41 lines
1.6 KiB
YAML
---
|
|
- name: Get the project name
|
|
set_fact:
|
|
gated_project_name: '{{ gated_change.project | regex_replace("^.*/", "") }}'
|
|
|
|
- name: Set project name when there is a dependency on tripleo-quickstart
|
|
set_fact:
|
|
gated_project_name: 'tripleo-quickstart-gate-repo'
|
|
when: gated_change.project == "openstack/tripleo-quickstart"
|
|
|
|
- name: |
|
|
Remove previously checked out git repo
|
|
(workaround for ansible bug https://github.com/ansible/ansible-modules-core/issues/5504 )
|
|
file:
|
|
path: '{{ lookup("env", "WORKSPACE") }}/{{ gated_project_name }}'
|
|
state: absent
|
|
# do not remove the repo if it was cloned by the jenkins job
|
|
when: gated_change.project != lookup('env', 'GERRIT_PROJECT')
|
|
|
|
- name: Check out the gated change
|
|
git:
|
|
repo: 'https://{{ gated_change.host }}/{{ gated_change.project }}'
|
|
dest: '{{ lookup("env", "WORKSPACE") }}/{{ gated_project_name }}'
|
|
refspec: '{{ gated_change.refspec }}'
|
|
version: 'FETCH_HEAD'
|
|
# do not check out the gated change if it was already cloned by the jenkins job
|
|
when: gated_change.project != lookup('env', 'GERRIT_PROJECT')
|
|
|
|
# do this only for the roles
|
|
- when: gated_change.project != "openstack/tripleo-quickstart"
|
|
block:
|
|
- name: Modify requirements
|
|
replace:
|
|
dest: '{{ lookup("env", "WORKSPACE") }}/tripleo-quickstart/quickstart-extras-requirements.txt'
|
|
regexp: '^.*egg={{ gated_project_name }}$'
|
|
replace: 'file://{{ lookup("env", "WORKSPACE") }}/{{ gated_project_name }}/#egg={{ gated_project_name }}'
|
|
- name: Make sure the package is not installed in our venv
|
|
pip:
|
|
name: '{{ gated_project_name }}'
|
|
state: absent
|