From 8c69a118df8d05cbd424e19e8fd7184f3a7b5805 Mon Sep 17 00:00:00 2001 From: Sergiy Markin Date: Mon, 26 Jun 2023 16:43:32 +0000 Subject: [PATCH] Add zuul gate variable This PS adds zuul gate variable args.chdir to the jobs where it has been missed. This variable helps to control relative path to the source code folder in cases when playbooks have been inherited. Change-Id: Iea56ea4d00b9449c129afb34f4f91952fcc015c4 --- tools/gate/playbooks/docker-image-build.yaml | 4 ++-- tools/gate/playbooks/make-functional-tests.yaml | 4 ++-- tools/gate/playbooks/zuul-linter.yaml | 2 +- zuul.d/base.yaml | 6 +++++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/gate/playbooks/docker-image-build.yaml b/tools/gate/playbooks/docker-image-build.yaml index 5b5d0bf3..272bf64f 100644 --- a/tools/gate/playbooks/docker-image-build.yaml +++ b/tools/gate/playbooks/docker-image-build.yaml @@ -63,7 +63,7 @@ when: not publish block: - make: - chdir: "{{ zuul.project.src_dir }}" + chdir: "{{ zuul.project.src_dir }}/{{ args.chdir }}" target: "build" params: DISTRO_SUFFIX: "{{ distro_suffix }}" @@ -90,7 +90,7 @@ password: "{{ quay_credentials.password }}" registry_url: "https://quay.io/api/v1/" - make: - chdir: "{{ zuul.project.src_dir }}" + chdir: "{{ zuul.project.src_dir }}/{{ args.chdir }}" target: "build" params: COMMIT: "{{ zuul.newrev | default('') }}" diff --git a/tools/gate/playbooks/make-functional-tests.yaml b/tools/gate/playbooks/make-functional-tests.yaml index 381a3316..f99b694a 100644 --- a/tools/gate/playbooks/make-functional-tests.yaml +++ b/tools/gate/playbooks/make-functional-tests.yaml @@ -16,7 +16,7 @@ - name: Execute the make target for unit testing block: - make: - chdir: "{{ zuul.project.src_dir }}" + chdir: "{{ zuul.project.src_dir }}/{{ args.chdir }}" target: unit_tests register: result failed_when: result.failed @@ -26,7 +26,7 @@ - name: Execute the make target for features testing block: - make: - chdir: "{{ zuul.project.src_dir }}" + chdir: "{{ zuul.project.src_dir }}/{{ args.chdir }}" target: feature_tests register: result failed_when: result.failed diff --git a/tools/gate/playbooks/zuul-linter.yaml b/tools/gate/playbooks/zuul-linter.yaml index 060f7c86..aa003e24 100644 --- a/tools/gate/playbooks/zuul-linter.yaml +++ b/tools/gate/playbooks/zuul-linter.yaml @@ -15,6 +15,6 @@ - name: Execute a Whitespace Linter check command: git grep -E -l " +$" args: - chdir: "{{ zuul.project.src_dir }}" + chdir: "{{ zuul.project.src_dir }}/{{ args.chdir }}" register: result failed_when: result.stdout != "" diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index 0768a934..55f96e9c 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -148,7 +148,8 @@ commit: false static: - latest - + args: + chdir: ../porthole - job: name: airship-porthole-linter @@ -157,6 +158,9 @@ run: tools/gate/playbooks/zuul-linter.yaml timeout: 300 nodeset: airship-porthole-focal-single-node + vars: + args: + chdir: ../porthole - job: name: airship-porthole-deploy-functional-tests-ubuntu_focal