def broadcast_email(kind, status=None): if not hasattr(env, 'mail_class'): env.mail_class = send_mail() if kind == 'start': env.mail_class.send_start(status) elif kind == 'end': env.mail_class.send_end(status)
def upgrade_all(bina=True, up_tyr=True, up_confs=True, kraken_wait=True): """Upgrade all navitia packages, databases and launch rebinarisation of all instances """ bina = get_bool_from_cli(bina) up_tyr = get_bool_from_cli(up_tyr) up_confs = get_bool_from_cli(up_confs) kraken_wait = get_bool_from_cli(kraken_wait) if env.use_load_balancer: get_adc_credentials() with utils.send_mail(): execute(check_last_dataset) if up_tyr: execute(upgrade_tyr, up_confs=up_confs) execute(upgrade_monitor_kraken_packages) if bina: execute(tyr.launch_rebinarization_upgrade) if env.use_load_balancer: # Upgrade kraken/jormun on first hosts set env.roledefs['eng'] = env.eng_hosts_1 env.roledefs['ws'] = env.ws_hosts_1 execute(switch_to_first_phase, env.eng_hosts_1, env.ws_hosts_1, env.ws_hosts_2) execute(upgrade_kraken, kraken_wait=kraken_wait, up_confs=up_confs) execute(upgrade_jormungandr, reload=False, up_confs=up_confs) # Upgrade kraken/jormun on remaining hosts env.roledefs['eng'] = env.eng_hosts_2 env.roledefs['ws'] = env.ws_hosts_2 execute(switch_to_second_phase, env.eng_hosts_1, env.eng_hosts_2, env.ws_hosts_1, env.ws_hosts_2) execute(upgrade_kraken, kraken_wait=kraken_wait, up_confs=up_confs) execute(upgrade_jormungandr, reload=False, up_confs=up_confs) execute(enable_all_nodes, env.eng_hosts, env.ws_hosts_1, env.ws_hosts_2) env.roledefs['eng'] = env.eng_hosts env.roledefs['ws'] = env.ws_hosts else: execute(upgrade_kraken, kraken_wait=kraken_wait, up_confs=up_confs) execute(upgrade_jormungandr, up_confs=up_confs)
def upgrade_all(bina=True, up_tyr=True, up_confs=True, kraken_wait=True): """Upgrade all navitia packages, databases and launch rebinarisation of all instances """ bina = get_bool_from_cli(bina) up_tyr = get_bool_from_cli(up_tyr) up_confs = get_bool_from_cli(up_confs) kraken_wait = get_bool_from_cli(kraken_wait) if env.use_load_balancer: get_adc_credentials() with utils.send_mail(): execute(check_last_dataset) if up_tyr: execute(upgrade_tyr, up_confs=up_confs) execute(upgrade_monitor_kraken_packages) if bina: execute(tyr.launch_rebinarization_upgrade) if env.use_load_balancer: # Upgrade kraken/jormun on first hosts set env.roledefs['eng'] = env.eng_hosts_1 env.roledefs['ws'] = env.ws_hosts_1 execute(switch_to_first_phase, env.eng_hosts_1, env.ws_hosts_1, env.ws_hosts_2) execute(upgrade_kraken, kraken_wait=kraken_wait, up_confs=up_confs) execute(upgrade_jormungandr, reload=False, up_confs=up_confs) # Upgrade kraken/jormun on remaining hosts env.roledefs['eng'] = env.eng_hosts_2 env.roledefs['ws'] = env.ws_hosts_2 execute(switch_to_second_phase, env.eng_hosts_1, env.eng_hosts_2, env.ws_hosts_1, env.ws_hosts_2) execute(upgrade_kraken, kraken_wait=kraken_wait, up_confs=up_confs) execute(upgrade_jormungandr, reload=False, up_confs=up_confs) execute(enable_all_nodes, env.eng_hosts, env.ws_hosts) env.roledefs['eng'] = env.eng_hosts env.roledefs['ws'] = env.ws_hosts else: execute(upgrade_kraken, kraken_wait=kraken_wait, up_confs=up_confs) execute(upgrade_jormungandr, up_confs=up_confs)