Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git Webhook Koji Target variable #1

Open
hanynowsky opened this issue Feb 19, 2014 · 5 comments
Open

Git Webhook Koji Target variable #1

hanynowsky opened this issue Feb 19, 2014 · 5 comments
Labels

Comments

@hanynowsky
Copy link

The KOJI-TARGET variable has a fixed value : 'dist-centos6' which is not what we want n that case.
We need a way to get dynamically the TARGET value.

@philicious
Copy link
Owner

Thats true if you have more than one build target. You would need to parse out the build target by the repo name or by a commit message tag like I did with #scratch. Or by any other variable that Github sends you.

@hanynowsky
Copy link
Author

True then.
Offtopic:
Suppose the following:

  • we have one global build target named = "centos65".
  • Apache is running on port 80 and port 443 (ssl).
  • We have a stash git webhook that sends an HTTP POst Json data to https://koji.mycompany.com/webhoohdata/mypackage/data; so we're expecting this koji_listener.py to launch a koji build once the HTTP POST notification is received. The question then, is where to put that script?: in /var/lib/kojihub-plugins? or somewhere in apache config folders? I mean how to activate it effectively?
  • So we have to change: application.listen(8080) to application.listen(80) ? Right?

@philicious
Copy link
Owner

Its not a Koji plugin. Its a standalone script that starts an tornado httpd. So you have to pick a free port. You cant use a port that apache is binding to.
You can either start it manually "python koji_listener.py >/dev/null 2>&1" or "python koji_listener.py > /var/log/listener.log &"
Or you could run it under supervisord or daemontools etc...

If you want it to be served from apache, you would need to rewrite the script. Remove tornado etc..

@hanynowsky
Copy link
Author

I am sorry! I still can't get it.
I am running a koji instance on a CentOS 6.5 machine.
if I run it manually, it complains about missing python modules, like tornado.ioloop. Which might be normal since tornado is not installed.
How would it get modules like: apache equivalent of tornado.ioloop, apache equivalent of tornado.web, json, koji .... , as they are not native python modules!

-EDIT:
Actually tornado is a python web server! I see. In that case, since we are running Apache HTTPD, I need to modify the script to use APACHE!! Some guidance? :(

@philicious
Copy link
Owner

"pip install tornado"

Koji modules are installed along with Koji.

For refactoring, you would need to remove the tornado skeleton and server the python script with mod_python. Its easier to just use it as it is and have a secondary httpd by the tornado.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants