Merge "Update requirements-check job to run on arbitrary targets"
This commit is contained in:
commit
7d062f8663
@ -10,6 +10,21 @@
|
||||
- job:
|
||||
name: requirements-check
|
||||
parent: unittests
|
||||
description: |
|
||||
Check that requirements in the target repo match OpenStack
|
||||
global requirements.
|
||||
|
||||
**Job Variables**
|
||||
|
||||
.. zuul:jobvar:: zuul_work_dir
|
||||
:default: {{ zuul.project.src_dir }}
|
||||
|
||||
Directory holding the project to check.
|
||||
|
||||
.. zuul:jobvar:: zuul_branch
|
||||
:default: {{ zuul.branch }}
|
||||
|
||||
Branch to check.
|
||||
# NOTE(gmann): Update the nodeset if we move testing to the new version
|
||||
# of ubuntu. We are explicitly setting the nodeset here because the base
|
||||
# job (unittests) moving to the ubuntu latest version can break this
|
||||
@ -28,3 +43,15 @@
|
||||
- ^doc/requirements.txt$
|
||||
- playbooks/requirements-check.yaml
|
||||
- ^lower-constraints.txt$
|
||||
|
||||
- job:
|
||||
name: requirements-check-self
|
||||
description: |
|
||||
Run the requirements-check job on another repo in order to
|
||||
self-test changes to its job configuration.
|
||||
parent: requirements-check
|
||||
# This could be any project, nova is chosen arbitrarily.
|
||||
required-projects: openstack/nova
|
||||
vars:
|
||||
zuul_work_dir: "{{ zuul.projects['opendev.org/openstack/nova'].src_dir }}"
|
||||
zuul_branch: "master"
|
||||
|
@ -13,6 +13,7 @@
|
||||
files:
|
||||
- bindep.txt
|
||||
- openstack-tox-validate
|
||||
- requirements-check-self
|
||||
- requirements-tox-babel
|
||||
- requirements-tox-bindep:
|
||||
voting: false
|
||||
@ -79,6 +80,7 @@
|
||||
files:
|
||||
- bindep.txt
|
||||
- openstack-tox-validate
|
||||
- requirements-check-self
|
||||
- requirements-tox-babel
|
||||
- requirements-tox-py39-check-uc
|
||||
- requirements-tox-py310-check-uc
|
||||
|
@ -1,16 +1,4 @@
|
||||
- hosts: all
|
||||
pre_tasks:
|
||||
- name: Ensure pip
|
||||
include_role:
|
||||
name: ensure-pip
|
||||
|
||||
tasks:
|
||||
- name: Install openstack_requirements
|
||||
command: "pip3 install --user {{ zuul.projects['opendev.org/openstack/requirements'].src_dir }}"
|
||||
|
||||
- name: Run requirements check script
|
||||
# Use command module here instead of script since Zuul gets output
|
||||
# with command into job-output.txt file.
|
||||
# Command expects the file to be at the remote system - the system
|
||||
# running the tests. Ask zuul variables for the path.
|
||||
command: "{{ zuul.projects['opendev.org/openstack/requirements'].src_dir }}/playbooks/files/project-requirements-change.py {{ zuul.project.src_dir }} {{ zuul.branch }}"
|
||||
roles:
|
||||
- ensure-pip
|
||||
- check-requirements
|
||||
|
13
roles/check-requirements/README.rst
Normal file
13
roles/check-requirements/README.rst
Normal file
@ -0,0 +1,13 @@
|
||||
Check that a project's requirements match the global requirements repo.
|
||||
|
||||
**Role Variables**
|
||||
|
||||
.. zuul:rolevar:: zuul_work_dir
|
||||
:default: {{ zuul.project.src_dir }}
|
||||
|
||||
Directory holding the project to check.
|
||||
|
||||
.. zuul:rolevar:: zuul_branch
|
||||
:default: {{ zuul.branch }}
|
||||
|
||||
Branch to check.
|
2
roles/check-requirements/defaults/main.yaml
Normal file
2
roles/check-requirements/defaults/main.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
zuul_work_dir: "{{ zuul.project.src_dir }}"
|
||||
zuul_branch: "{{ zuul.branch }}"
|
9
roles/check-requirements/tasks/main.yaml
Normal file
9
roles/check-requirements/tasks/main.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
- name: Install openstack_requirements
|
||||
command: "pip3 install --user {{ zuul.projects['opendev.org/openstack/requirements'].src_dir }}"
|
||||
|
||||
- name: Run requirements check script
|
||||
# Use command module here instead of script since Zuul gets output
|
||||
# with command into job-output.txt file.
|
||||
# Command expects the file to be at the remote system - the system
|
||||
# running the tests. Ask zuul variables for the path.
|
||||
command: "{{ zuul.projects['opendev.org/openstack/requirements'].src_dir }}/playbooks/files/project-requirements-change.py {{ zuul_work_dir }} {{ zuul_branch }}"
|
Loading…
Reference in New Issue
Block a user