Run the koji owner sync everytime a scm request is process.
This commit is contained in:
parent
02bc4ab2cb
commit
06df919c1b
3 changed files with 75 additions and 0 deletions
9
roles/bodhi2/backend/files/fedwatch.conf
Normal file
9
roles/bodhi2/backend/files/fedwatch.conf
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"io.pagure.prod.pagure.issue.edit": {
|
||||
"args": [
|
||||
"msg/project/fullname",
|
||||
"msg/fields",
|
||||
"msg/issue/content"
|
||||
]
|
||||
}
|
||||
}
|
42
roles/bodhi2/backend/files/koji-sync-fedwatch-glue.py
Normal file
42
roles/bodhi2/backend/files/koji-sync-fedwatch-glue.py
Normal file
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/env python
|
||||
""" This is a glue script to run /usr/local/bin/owner-sync-pagure on a given
|
||||
package anytime a ticket gets closed at
|
||||
https://pagure.io/releng/fedora-scm-requests
|
||||
|
||||
Author: Ralph Bean <rbean@redhat.com>
|
||||
"""
|
||||
|
||||
import json
|
||||
import subprocess as sp
|
||||
import sys
|
||||
|
||||
|
||||
def handle(content):
|
||||
body = content.strip('`').strip()
|
||||
body = json.loads(body)
|
||||
package = body['repo']
|
||||
# XXX If you modify this taglist. Please also modify the other copy in
|
||||
# bodhi2/backend/tasks/main.yml
|
||||
taglist = 'f27 f26 f25 f27-container f26-container f25-container epel7 dist-6E-epel module-package-list'
|
||||
cmd = [
|
||||
'/usr/local/bin/owner-sync-pagure',
|
||||
'--package', package,
|
||||
'--verbose',
|
||||
] + taglist.split()
|
||||
sp.Popen(cmd)
|
||||
|
||||
|
||||
def main(fullname, fields, content):
|
||||
if fullname != 'releng/fedora-scm-requests':
|
||||
print("Dropping %r. Not scm request.")
|
||||
return False
|
||||
if 'close_status' not in fields:
|
||||
print("Dropping %r. Not closed.")
|
||||
return False
|
||||
|
||||
handle(content)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
fullname, fields, content = sys.argv[-3:]
|
||||
main(fullname, fields, content)
|
|
@ -26,6 +26,7 @@
|
|||
- python-scandir
|
||||
- python2-productmd
|
||||
- compose-utils
|
||||
- fedwatch
|
||||
tags:
|
||||
- packages
|
||||
- bodhi
|
||||
|
@ -160,6 +161,8 @@
|
|||
- cron
|
||||
|
||||
- name: sync packages from pagure-on-dist-git to koji (all branches)
|
||||
# XXX If you modify this taglist. Please also modify the other copy in
|
||||
# bodhi2/backend/tasks/main.yml
|
||||
cron: name="owner-sync" minute="15" user="root"
|
||||
job="/usr/local/bin/lock-wrapper owner-sync '/usr/local/bin/owner-sync-pagure f27 f26 f25 f27-container f26-container f25-container epel7 dist-6E-epel module-package-list'"
|
||||
cron_file=update-koji-owner
|
||||
|
@ -168,6 +171,27 @@
|
|||
- bodhi
|
||||
- cron
|
||||
|
||||
- name: configure fedwatch to sync packages as soon as requests are process.
|
||||
copy: src=fedwatch.conf dest=/etc/fedwatch.conf
|
||||
tags:
|
||||
- bodhi
|
||||
- fedwatch
|
||||
|
||||
- name: put the fedwatch koji sync glue script in place
|
||||
copy:
|
||||
src: koji-sync-fedwatch-glue.py
|
||||
dest: /etc/fedwatch.d/koji-sync-fedwatch-glue.py
|
||||
mode: 0755
|
||||
tags:
|
||||
- bodhi
|
||||
- fedwatch
|
||||
|
||||
- name: start fedwatch
|
||||
service: name=fedwatch enabled=yes state=started
|
||||
tags:
|
||||
- bodhi
|
||||
- fedwatch
|
||||
|
||||
#
|
||||
# cron job that syncs updates to master mirror
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue