From 70a00e69257730681828a738d3ebeed0890b8620 Mon Sep 17 00:00:00 2001 From: Tomas Hrnciar Date: Tue, 8 Oct 2019 11:21:11 +0200 Subject: [PATCH] copr-fe: adds PAGURE_INSTANCES --- inventory/group_vars/copr_front_dev | 5 +++++ roles/copr/frontend-cloud/templates/copr.conf | 17 +++++++++++++---- roles/copr/frontend/templates/copr.conf | 17 +++++++++++++---- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/inventory/group_vars/copr_front_dev b/inventory/group_vars/copr_front_dev index 98d1022611..62fba38e52 100644 --- a/inventory/group_vars/copr_front_dev +++ b/inventory/group_vars/copr_front_dev @@ -26,3 +26,8 @@ whitelist_emails: - dturecek@redhat.com - thrnciar@redhat.com - schlupov@redhat.com + +copr_pagure_events: + io.pagure.prod.pagure: "https://pagure.io/" + org.fedoraproject.prod.pagure: "https://src.fedoraproject.org/" + io.pagure.stg.pagure: "https://stg.pagure.io" diff --git a/roles/copr/frontend-cloud/templates/copr.conf b/roles/copr/frontend-cloud/templates/copr.conf index 00bcb1ec88..c21d04ffd7 100644 --- a/roles/copr/frontend-cloud/templates/copr.conf +++ b/roles/copr/frontend-cloud/templates/copr.conf @@ -107,8 +107,17 @@ WHITELIST_EMAILS = [ ] {% endif %} -{% if not devel %} -PAGURE_INSTANCES = ['io.pagure.prod.pagure', 'org.fedoraproject.prod.pagure'] -{% else %} -PAGURE_INSTANCES = ['io.pagure.prod.pagure', 'org.fedoraproject.prod.pagure', 'io.pagure.stg.pagure'] +PAGURE_EVENTS = { +{% if copr_pagure_events %} + {% for instance, url in copr_pagure_events.items() %} + {% for topic in [ + 'git.receive', + 'pull-request.new', + 'pull-request.rebased', + 'pull-request.updated', + 'pull-request.comment.added'] %} + '{{ instance }}.{{ topic }}' : '{{ url }}', + {% endfor %} + {% endfor %} {% endif %} +} diff --git a/roles/copr/frontend/templates/copr.conf b/roles/copr/frontend/templates/copr.conf index 476d4d0b62..5959c0ebc0 100644 --- a/roles/copr/frontend/templates/copr.conf +++ b/roles/copr/frontend/templates/copr.conf @@ -80,8 +80,17 @@ WHITELIST_EMAILS = [ ] {% endif %} -{% if not devel %} -PAGURE_INSTANCES = ['io.pagure.prod.pagure', 'org.fedoraproject.prod.pagure'] -{% else %} -PAGURE_INSTANCES = ['io.pagure.prod.pagure', 'org.fedoraproject.prod.pagure', 'io.pagure.stg.pagure'] +PAGURE_EVENTS = { +{% if copr_pagure_events %} + {% for instance, url in copr_pagure_events.items() %} + {% for topic in [ + 'git.receive', + 'pull-request.new', + 'pull-request.rebased', + 'pull-request.updated', + 'pull-request.comment.added'] %} + '{{ instance }}.{{ topic }}' : '{{ url }}', + {% endfor %} + {% endfor %} {% endif %} +}