Run check-requirements in the directory of the change

The script assumes it's being run in the directory containing the
proposed change, so we should chdir there. While we're at it, collapse
this to use the 'script' module which copies a script and executes it.

Change-Id: I43ed49d523c3131aad6c892c78fd95aba65c30fe
This commit is contained in:
Monty Taylor 2017-10-09 08:19:44 -05:00
parent d645c384dd
commit 4054ec9fb8
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
2 changed files with 5 additions and 6 deletions

@ -7,6 +7,7 @@
- ^tools/.*-requires$
- ^.*requirements.txt$
- ^.*requirements-py[2,3].txt$
- playbooks/requirements-check.yaml
gate:
jobs:
- requirements-check:
@ -14,6 +15,7 @@
- ^tools/.*-requires$
- ^.*requirements.txt$
- ^.*requirements-py[2,3].txt$
- playbooks/requirements-check.yaml
- job:
name: requirements-check

@ -1,9 +1,6 @@
- hosts: all
tasks:
- name: Copy requirements check script
copy:
src: files/project-requirements-change.py
dest: "{{ ansible_user_dir }}/project-requirements-change.py"
- name: Run requirements check script
command: "python project-requirements-change.py {{ zuul.branch }}"
script: "files/project-requirements-change.py {{ zuul.branch }}"
args:
chdir: "{{ zuul.project.src_dir }}"