pagure-2-openshift is webhook proxy service that allow to trigger Openshift build using pagure webhook feature.
This service act as a bridge between Pagure and Openshift, it receives Pagure's webhook POST requests sent on every commit made to the git repository and sent a POST request with the format expected by Openshift to trigger a new build.
pagure-2-openshift is using the following configuration keys :
PAGURE_SECRET
: Private key provided by pagure. This key is used to authenticate the POST requests received by the service.
OPENSHIFT_SECRET
: Secret used to trigger the generic webhook of openshift.
OPENSHIFT_CLUSTER
: hostname of the openshift cluster used to build an application.
OPENSHIFT_PROJECT
: Name of the project (namespace) in openshift.
OPENSHIFT_APP
: Name of the application to build with openshift.
In the project's settings generate a Private web-hook key
this is your PAGURE_SECRET
.
Then in the Project options
add the following url to the Activate Web-hooks
input box http://hostnameofpagure2openshift:5000/pagure
.
Finally in the Hooks
activate the Fedmsg
.
To install the application use the provided requeriments.txt
and pip
in a virtual environment.
$ python3 -m venv .p2o $ source .p2o/bin/activate (p20) $ pip install -r requirements.txt
To run the application use gunicorn
web server inside the virtual environment.
(p20) $ gunicorn --worker 1 --bind 0.0.0.0:5000 wsgi:application
Change the number of worker if you need to scale the service.
To deploy a pagure-2-openshift service on Openshift use the provided openshift.json
this will create everything required
except for the configMap that will hold the configuration items.
Before importing the openshift.json
file create a configMap using the provided configmap.yml
and update the configuration
values.