Merge "Use upper-constraints in the Tobiko ansible roles"
This commit is contained in:
commit
205b496e37
roles
tobiko-bindep/tasks
tobiko-common/defaults
tobiko-ensure-python3/tasks
tobiko-ensure-tox/tasks
@ -1,8 +1,16 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
- name: "check if upper-constraints file exists"
|
||||||
|
stat:
|
||||||
|
path: "{{ openstack_requirements_dir }}/upper-constraints.txt"
|
||||||
|
register: upper_constraints_file
|
||||||
|
|
||||||
|
|
||||||
- name: "ensure Bindep is installed"
|
- name: "ensure Bindep is installed"
|
||||||
command: >
|
command: >
|
||||||
'{{ python_executable }}' -m pip install --user 'bindep>={{ bindep_min_version }}'
|
'{{ python_executable }}' -m pip install \
|
||||||
|
{% if upper_constraints_file.stat.exists == true %}-c'{{ upper_constraints_file.stat.path }}'{% endif %} \
|
||||||
|
--user bindep>='{{ bindep_min_version }}'
|
||||||
register: install_bindep
|
register: install_bindep
|
||||||
changed_when: "'Successfully installed' in install_bindep.stdout"
|
changed_when: "'Successfully installed' in install_bindep.stdout"
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@ test_project:
|
|||||||
test_git_repo: '{{ git_base }}/x/tobiko.git'
|
test_git_repo: '{{ git_base }}/x/tobiko.git'
|
||||||
test_src_dir: ''
|
test_src_dir: ''
|
||||||
|
|
||||||
|
openstack_requirements_dir: "/opt/stack/requirements"
|
||||||
|
|
||||||
|
|
||||||
# NOTE: if test_dir and tobiko_dir variables endup being the same actual
|
# NOTE: if test_dir and tobiko_dir variables endup being the same actual
|
||||||
# directory then test_src and test_git_* variables will be overriden
|
# directory then test_src and test_git_* variables will be overriden
|
||||||
|
@ -57,10 +57,17 @@
|
|||||||
failed_when: (python_info | length) == 0
|
failed_when: (python_info | length) == 0
|
||||||
|
|
||||||
|
|
||||||
|
- name: "check if upper-constraints file exists"
|
||||||
|
stat:
|
||||||
|
path: "{{ openstack_requirements_dir }}/upper-constraints.txt"
|
||||||
|
register: upper_constraints_file
|
||||||
|
|
||||||
|
|
||||||
- name: "upgrade '{{ python_command }}' packages to the latest versions"
|
- name: "upgrade '{{ python_command }}' packages to the latest versions"
|
||||||
command: >
|
command: >
|
||||||
'{{ python_info[python_command].executable }}' -m pip install '{{ item }}' \
|
'{{ python_info[python_command].executable }}' -m pip install \
|
||||||
--upgrade --user
|
{% if upper_constraints_file.stat.exists == true %}-c'{{ upper_constraints_file.stat.path }}'{% endif %}
|
||||||
|
'{{ item }}' --upgrade --user
|
||||||
register: upgrade_python_packages
|
register: upgrade_python_packages
|
||||||
changed_when:
|
changed_when:
|
||||||
"'Successfully installed' in upgrade_python_packages.stdout"
|
"'Successfully installed' in upgrade_python_packages.stdout"
|
||||||
|
@ -1,9 +1,31 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
- name: "check if upper-constraints file exists"
|
||||||
|
stat:
|
||||||
|
path: "{{ openstack_requirements_dir }}/upper-constraints.txt"
|
||||||
|
register: upper_constraints_file
|
||||||
|
|
||||||
|
|
||||||
|
- name: "Determine min tox version to be installed"
|
||||||
|
when: upper_constraints_file.stat.exists == true
|
||||||
|
block:
|
||||||
|
- name: "Check requirements repo branch"
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: git rev-parse --abbrev-ref HEAD
|
||||||
|
chdir: "{{ openstack_requirements_dir }}"
|
||||||
|
register: requirements_branch
|
||||||
|
|
||||||
|
- name: "Set min tox version for Ubuntu 20.04"
|
||||||
|
set_fact:
|
||||||
|
tox_min_version: "3.28"
|
||||||
|
when: requirements_branch.stdout == "stable/2023.1" or "stable/zed"
|
||||||
|
|
||||||
|
|
||||||
- name: "ensure Tox is installed"
|
- name: "ensure Tox is installed"
|
||||||
command: >
|
command: >
|
||||||
{{ python_executable }} -m pip install --user
|
'{{ python_executable }}' -m pip install \
|
||||||
'tox>={{ tox_min_version }}{% if tox_max_version is not none %},<={{ tox_max_version }}{% endif %}'
|
{% if upper_constraints_file.stat.exists is true %}-c'{{ upper_constraints_file.stat.path }}'{% endif %} \
|
||||||
|
--user 'tox>={{ tox_min_version }}{% if tox_max_version is not none %},<={{ tox_max_version }}{% endif %}'
|
||||||
register: install_tox
|
register: install_tox
|
||||||
changed_when: "'Successfully installed' in install_tox.stdout"
|
changed_when: "'Successfully installed' in install_tox.stdout"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user