--- /dev/null
+#!/usr/bin/env python
+# vim: ai ts=4 sts=4 et sw=4
+
+"""
+This code is called by jenkins jobs triggered by OBS events.
+"""
+
+import os
+import sys
+import re
+import json
+import base64
+
+from common.buildtrigger import trigger_info, trigger_next
+from common.iris_rest_client import IrisRestClient
+
+
+def main():
+ """Script entry point."""
+
+ print '---[JOB STARTED: %s ]-------------------------'
+
+ obs_api = os.getenv("OBS_API_URL")
+ obs_user = os.getenv("OBS_API_USERNAME")
+ obs_passwd = os.getenv("OBS_API_PASSWD")
+ base_url = os.getenv("URL_PUBLIC_REPO_BASE")
+ base_path = os.getenv('PATH_REPO_BASE')
+ live_repo_base = os.getenv('PATH_LIVE_REPO_BASE')
+
+ content = trigger_info(os.getenv("TRIGGER_INFO"))
+ pub_enabled = os.getenv("IRIS_PUB_ENABLED", "0") != "0"
+ if pub_enabled:
+ rest = IrisRestClient(
+ os.getenv("IRIS_SERVER"),
+ os.getenv("IRIS_USERNAME"),
+ base64.b64decode(os.getenv('IRIS_PASSWORDX','')))
+ rest.publish_event("package_built", {
+ "project": content.get('project'),
+ "repo": content.get('repository'),
+ "name": content.get('package'),
+ "arch": content.get('arch'),
+ "status": content.get('event_type'),
+ "repo_server": content.get('reposerver'),
+ })
+
+ return 0
+
+if __name__ == '__main__':
+ sys.exit(main())