blob: 9775b851f1b4f57b7c026003ac930b25fb29473b [file] [log] [blame]
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})
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})