066855a039
With this patch, Pungi can invoke an arbitrary command on various moments of the compose process. The invoked command can the decide on what message to send (and using what messaging system). The actual command is specified in the config file. There is a script provided that sends the messages via fedmsg. The documentation is updated to have details about the new config option as well as the interface for the messaging script. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
21 lines
426 B
Python
Executable File
21 lines
426 B
Python
Executable File
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import argparse
|
|
import fedmsg
|
|
import json
|
|
import sys
|
|
|
|
|
|
def send(cmd, data):
|
|
topic = 'compose.%s' % cmd.replace('-', '.').lower()
|
|
fedmsg.publish(topic=topic, modname='pungi', msg=data)
|
|
|
|
if __name__ == '__main__':
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument('cmd')
|
|
|
|
opts = parser.parse_args()
|
|
data = json.load(sys.stdin)
|
|
send(opts.cmd, data)
|