| 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']}) |