Browse Source

Add services for testing based on test repo name

Rather than have to define a job per non-aio service, we have
zuul introspect the origin test repo and add the service name
to the scenario variable on the fly. This allows us to simplify
our job definitions and simply use the AIO job template for all
repositories.

Change-Id: I592d51171ecef5e30c54e71bf4c00d96787bce36
changes/98/658398/12
Jesse Pretorius 1 month ago
parent
commit
900376c5bf
1 changed files with 26 additions and 0 deletions
  1. 26
    0
      zuul.d/playbooks/run.yml

+ 26
- 0
zuul.d/playbooks/run.yml View File

@@ -1,5 +1,31 @@
1 1
 - hosts: all
2
+  vars:
3
+    scenario_map:
4
+      aodh: telemetry
5
+      ceilometer: telemetry
6
+      gnocchi: telemetry
7
+      horizon: lxc
2 8
   tasks:
9
+    - name: Dynamically determine additional scenario elements
10
+      when:
11
+        - zuul.project.short_name is match("^openstack-ansible-os_(.*)$")
12
+        - (dynamic_scenario | default(True)) | bool
13
+      block:
14
+        - name: Set service_name
15
+          set_fact:
16
+            service_name: "{{ zuul.project.short_name | regex_replace('^openstack-ansible-os_(.*)$', '\\1') }}"
17
+
18
+        - name: Set scenario_suffix
19
+          set_fact:
20
+            scenario_suffix: "{{ scenario_map[service_name] | default(service_name) }}"
21
+
22
+        # Horizon's apache uses the same ip:port combinations as
23
+        # the repo server's nginx service. As such, we force the
24
+        # use of containers to ensure that they do not conflict.
25
+        - name: Add services based on test repo name
26
+          set_fact:
27
+            scenario: "{{ (service_name == 'horizon') | ternary(scenario | regex_replace('_metal', ''), scenario) }}_{{ scenario_suffix }}"
28
+
3 29
     - name: Run gate-check-commit.sh script
4 30
       become: yes
5 31
       become_user: root

Loading…
Cancel
Save