From e778ada47e67e6bcca6a71aa90d0f996bb733d5d Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Mar 22 2021 13:52:24 +0000 Subject: Ensure rpm-lint check rpm / srpm and spec file This change fetches the sprm is available in the local directory. The rpmlint command is now called on the directory to automatically discover content to lint. --- diff --git a/roles/rpm-lint/tasks/main.yaml b/roles/rpm-lint/tasks/main.yaml index 1f0779c..8cb865b 100644 --- a/roles/rpm-lint/tasks/main.yaml +++ b/roles/rpm-lint/tasks/main.yaml @@ -5,12 +5,18 @@ state: latest become: true -- name: Fetch rpm +- name: Fetch rpms get_url: url: "{{ item }}" - dest: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/{{ item | basename }}" + dest: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/" loop: "{{ rpms }}" +- name: Fetch srpm + get_url: + url: "{{ srpm }}" + dest: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/" + when: srpm is defined + - name: Get rpmlintrc path shell: ls {{ ansible_user_dir }}/{{ zuul.project.src_dir }}/*.rpmlintrc register: rpmlintrc_check @@ -22,4 +28,6 @@ when: rpmlintrc_check is succeeded - name: Run rpmlint - shell: rpmlint {% if rpmlintrc | default("") %} --file {{ rpmlintrc }} {% endif %} {{ ansible_user_dir }}/{{ zuul.project.src_dir }}/*.rpm + shell: rpmlint {% if rpmlintrc | default("") %} --file {{ rpmlintrc }} {% endif %} ./ + args: + chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"