Add initial version of nolabs website
diff --git a/app/jenkins_request.py b/app/jenkins_request.py
new file mode 100644
index 0000000..aa118b2
--- /dev/null
+++ b/app/jenkins_request.py
@@ -0,0 +1,11 @@
+from flask import current_app
+
+from jenkins import Jenkins
+
+def handle_booking_job(booking_id, deploy_scenario):
+ jenkins_server = Jenkins(current_app.config['JENKINS_URL'], username=current_app.config['JENKINS_NOLABS_USERNAME'], password=current_app.config['JENKINS_NOLABS_TOKEN'])
+ jenkins_server.build_job(current_app.config['JENKINS_HANDLE_BOOKING_JOB'], {'BOOKING_ID': booking_id, 'DEPLOY_SCENARIO': deploy_scenario, 'SLAVE_LABEL': current_app.config['JENKINS_SLAVE_LABEL']})
+
+def delete_booking_job(booking_id, deploy_scenario):
+ jenkins_server = Jenkins(current_app.config['JENKINS_URL'], username=current_app.config['JENKINS_NOLABS_USERNAME'], password=current_app.config['JENKINS_NOLABS_TOKEN'])
+ jenkins_server.build_job(current_app.config['JENKINS_DELETE_BOOKING_JOB'], {'BOOKING_ID': booking_id, 'DEPLOY_SCENARIO': deploy_scenario,'SLAVE_LABEL': current_app.config['JENKINS_SLAVE_LABEL']})