def do_move_in_panopticon(source_topic, destination_topic): util.use_random_host('class-backend') print("\nRetagging content on %s" % (api.env.host_string, )) util.rake('panopticon', 'move_content_to_new_topic', source=source_topic, dest=destination_topic)
def reindex_app(app): puts("Rebuilding search index for application '%s'" % app) machine_class, rake_tasks = SEARCHABLE_APPS[app] util.use_random_host('class-%s' % machine_class) for rake_task in rake_tasks: util.rake(app, rake_task)
def prepare_publisher_csv(output_directory, source_topic, destination_topic): util.use_random_host('class-backend') print("\nFetching publisher change CSV from %s" % (api.env.host_string, )) filename = build_filename('publisher', source_topic, destination_topic) remote_path = '/var/apps/publisher/tmp/%s' % (filename, ) util.rake('publisher', 'topic_changes:prepare', source_topic, destination_topic, remote_path) api.get(remote_path, os.path.join(output_directory, filename)) api.sudo("rm '%s'" % (remote_path, ), user="******")
def prepare_publisher_csv(output_directory, source_topic, destination_topic): util.use_random_host('class-backend') print("\nFetching publisher change CSV from %s" % (api.env.host_string,)) filename = build_filename('publisher', source_topic, destination_topic) remote_path = '/var/apps/publisher/tmp/%s' % (filename,) util.rake('publisher', 'topic_changes:prepare', source_topic, destination_topic, remote_path) api.get(remote_path, os.path.join(output_directory, filename)) api.sudo("rm '%s'" % (remote_path,), user="******")
def reindex_app(app): puts("Rebuilding search index for application '%s'" % app) machine_class, tasks = SEARCHABLE_APPS[app] util.use_random_host('class-%s' % machine_class) for task in tasks: # FIXME: Remove this horrible hack of a hack for a hack if app == 'recommended-links': with cd('/data/vhost/recommended-links.*/current'): sudo('govuk_setenv default bundle exec rake -v "%s" --trace' % task, user='******') else: util.rake(app, task)
def prepare_whitehall_csv(output_directory, source_topic, destination_topic): util.use_random_host('class-whitehall_backend') print("\nFetching whitehall change CSV from %s" % (api.env.host_string,)) filename = build_filename('whitehall', source_topic, destination_topic) remote_path = '/var/apps/whitehall/tmp/%s' % (filename,) util.rake('whitehall', 'topic_retagging_csv_export', SOURCE=source_topic, DESTINATION=destination_topic, CSV_LOCATION=remote_path, ) api.get(remote_path, os.path.join(output_directory, filename)) api.sudo("rm '%s'" % (remote_path,), user="******")
def prepare_whitehall_csv(output_directory, source_topic, destination_topic): util.use_random_host('class-whitehall_backend') print("\nFetching whitehall change CSV from %s" % (api.env.host_string, )) filename = build_filename('whitehall', source_topic, destination_topic) remote_path = '/var/apps/whitehall/tmp/%s' % (filename, ) util.rake( 'whitehall', 'topic_retagging_csv_export', SOURCE=source_topic, DESTINATION=destination_topic, CSV_LOCATION=remote_path, ) api.get(remote_path, os.path.join(output_directory, filename)) api.sudo("rm '%s'" % (remote_path, ), user="******")
def process_publisher_csvs(paths): util.use_random_host('class-backend') for path in paths: process_publisher_csv(path)
def status(): """Get the status of locksmith""" util.use_random_host('class-etcd') check_locksmithctl() run("{0} -endpoint='{1}' status".format(locksmithctl, etcd_cluster))
def change(old_url, new_url): """Change a mainstream slug. Usage: fab integration mainstream_slugs.change:old_slug=/old-slug,new_slug=/new-slug""" util.use_random_host("class-backend") util.rake("panopticon", "delete_mainstream_slug_from_search", old_url) util.rake("publisher", "update_mainstream_slug", old_url, new_url)
def unlock(machine_name): """Unlock a machine with locksmith""" util.use_random_host('class-etcd') check_locksmithctl() run("{0} -endpoint='{1}' unlock '{2}'".format(locksmithctl, etcd_cluster, machine_name))
def do_delete_topic(old_topic): util.use_random_host('class-backend') print("\nDeleting old topic %s" % (old_topic, )) util.rake('panopticon', 'specialist_sector_cleanup', SLUG=old_topic)
def process_whitehall_csvs(paths): util.use_random_host('class-whitehall_backend') for path in paths: process_whitehall_csv(path)
def unlock(machine_name): """Unlock a machine with locksmith""" util.use_random_host('class-etcd') check_locksmithctl() run("{0} -endpoint='{1}' unlock '{2}'".format(locksmithctl, etcd_cluster, machine_name))
def do_delete_topic(old_topic): util.use_random_host('class-backend') print("\nDeleting old topic %s" % (old_topic,)) util.rake('panopticon', 'specialist_sector_cleanup', SLUG=old_topic)
def process_whitehall_csvs(paths): util.use_random_host('class-whitehall_backend') for path in paths: process_whitehall_csv(path)
def change(old_url, new_url): """Change a mainstream slug. Usage: fab integration mainstream_slugs.change:old_slug=/old-slug,new_slug=/new-slug""" util.use_random_host('class-backend') util.rake('panopticon', 'delete_mainstream_slug_from_search', old_url) util.rake('publisher', 'update_mainstream_slug', old_url, new_url)
def do_move_in_panopticon(source_topic, destination_topic): util.use_random_host('class-backend') print("\nRetagging content on %s" % (api.env.host_string,)) util.rake('panopticon', 'move_content_to_new_topic', source=source_topic, dest=destination_topic)
def process_publisher_csvs(paths): util.use_random_host('class-backend') for path in paths: process_publisher_csv(path)
def change(old_url, new_url): """Change a mainstream slug. Usage: fab preview mainstream_slugs.change:old_slug=/old-slug,new_slug=/new-slug""" util.use_random_host('class-backend') util.rake('panopticon', 'delete_mainstream_slug_from_search', old_url) util.rake('publisher', 'update_mainstream_slug', old_url, new_url)
def status(): """Get the status of locksmith""" util.use_random_host('class-etcd') check_locksmithctl() run("{0} -endpoint='{1}' status".format(locksmithctl, etcd_cluster))