Esempio n. 1
0
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)
Esempio n. 2
0
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)
Esempio n. 3
0
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="******")
Esempio n. 4
0
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="******")
Esempio n. 5
0
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)
Esempio n. 6
0
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="******")
Esempio n. 7
0
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="******")
Esempio n. 8
0
def process_publisher_csvs(paths):
    util.use_random_host('class-backend')
    for path in paths:
        process_publisher_csv(path)
Esempio n. 9
0
def status():
    """Get the status of locksmith"""
    util.use_random_host('class-etcd')
    check_locksmithctl()
    run("{0} -endpoint='{1}' status".format(locksmithctl, etcd_cluster))
Esempio n. 10
0
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)
Esempio n. 11
0
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))
Esempio n. 12
0
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)
Esempio n. 13
0
def process_whitehall_csvs(paths):
    util.use_random_host('class-whitehall_backend')
    for path in paths:
        process_whitehall_csv(path)
Esempio n. 14
0
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))
Esempio n. 15
0
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)
Esempio n. 16
0
def process_whitehall_csvs(paths):
    util.use_random_host('class-whitehall_backend')
    for path in paths:
        process_whitehall_csv(path)
Esempio n. 17
0
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)
Esempio n. 18
0
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)
Esempio n. 19
0
def process_publisher_csvs(paths):
    util.use_random_host('class-backend')
    for path in paths:
        process_publisher_csv(path)
Esempio n. 20
0
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)
Esempio n. 21
0
def status():
    """Get the status of locksmith"""
    util.use_random_host('class-etcd')
    check_locksmithctl()
    run("{0} -endpoint='{1}' status".format(locksmithctl, etcd_cluster))