blob: 9775b851f1b4f57b7c026003ac930b25fb29473b [file] [log] [blame]
Fatih Degirmencic2a46012019-09-30 12:07:45 +02001from flask import current_app
2
3from jenkins import Jenkins
4
5def handle_booking_job(booking_id, deploy_scenario):
6 jenkins_server = Jenkins(current_app.config['JENKINS_URL'], username=current_app.config['JENKINS_NOLABS_USERNAME'], password=current_app.config['JENKINS_NOLABS_TOKEN'])
Fatih Degirmenciadb77ef2019-10-02 06:00:46 +00007 jenkins_server.build_job(current_app.config['JENKINS_HANDLE_BOOKING_JOB'], {'BOOKING_ID': booking_id, 'DEPLOY_SCENARIO': deploy_scenario})
Fatih Degirmencic2a46012019-09-30 12:07:45 +02008
9def delete_booking_job(booking_id, deploy_scenario):
10 jenkins_server = Jenkins(current_app.config['JENKINS_URL'], username=current_app.config['JENKINS_NOLABS_USERNAME'], password=current_app.config['JENKINS_NOLABS_TOKEN'])
Fatih Degirmenciadb77ef2019-10-02 06:00:46 +000011 jenkins_server.build_job(current_app.config['JENKINS_DELETE_BOOKING_JOB'], {'BOOKING_ID': booking_id, 'DEPLOY_SCENARIO': deploy_scenario})