Skip to main content

publishing-api: Rake tasks

These rake tasks come from the desc descriptions in publishing-api’s lib/tasks folder. To change what’s shown here, change the description in the code.

add_document_type_to_host_content_update_events

Add a document type to the payload of HostContentUpdateJob events

k exec deploy/publishing-api -- rake add_document_type_to_host_content_update_events

View source (lib/tasks/add_document_type_to_host_content_update_events.rake)

Add link_set_content_id to links

k exec deploy/publishing-api -- rake add_link_set_content_id_to_links[link_id]

View source (lib/tasks/add_link_set_content_id_to_links.rake)

build_schema

Build individual schema

k exec deploy/publishing-api -- rake build_schema[schema]

View source (lib/tasks/build_schema.rake)

build_schemas

regenerate schemas and validate

k exec deploy/publishing-api -- rake build_schemas

View source (lib/tasks/build_schemas.rake)

csv_report:word_usages

Finds all references to a word being used across full details fields - pass in comma separated list of words

k exec deploy/publishing-api -- rake csv_report:word_usages

View source (lib/tasks/csv_report.rake)

csv_report:publishings_by_date_range

Prints a CSV of all editions that were published between the from and until timestamp

k exec deploy/publishing-api -- rake csv_report:publishings_by_date_range[from,until]

View source (lib/tasks/csv_report.rake)

csv_report:unpublishings_by_date_range

Prints a CSV of all editions that were unpublished between the from and until timestamp

k exec deploy/publishing-api -- rake csv_report:unpublishings_by_date_range[from,until]

View source (lib/tasks/csv_report.rake)

data_hygiene:remove_change_note:dry

Remove a change note from a document and represent to the content store (dry run)

k exec deploy/publishing-api -- rake data_hygiene:remove_change_note:dry[content_id,locale,query]

View source (lib/tasks/data_hygiene.rake)

data_hygiene:remove_change_note:real

Remove a change note from a document and represent to the content store (for reals)

k exec deploy/publishing-api -- rake data_hygiene:remove_change_note:real[content_id,locale,query]

View source (lib/tasks/data_hygiene.rake)

data_hygiene:document_status_check

Check the status of a document whether it’s in Content Store

k exec deploy/publishing-api -- rake data_hygiene:document_status_check[content_id,locale]

View source (lib/tasks/data_hygiene.rake)

data_hygiene:bulk_update_organisation

Bulk update the organisations associated with documents.

k exec deploy/publishing-api -- rake data_hygiene:bulk_update_organisation[csv_filename]

View source (lib/tasks/data_hygiene.rake)

data_hygiene:discard_drafts_and_unpublish

Discard drafts (if present) and unpublish

k exec deploy/publishing-api -- rake data_hygiene:discard_drafts_and_unpublish[content_id]

View source (lib/tasks/data_hygiene.rake)

discard_draft

Discard all drafts for a content item

k exec deploy/publishing-api -- rake discard_draft[content_id]

View source (lib/tasks/discard_draft.rake)

duplicate_content_items:all

Perform all checks for duplicate content items

k exec deploy/publishing-api -- rake duplicate_content_items:all

View source (lib/tasks/duplicate_content_items.rake)

duplicate_content_items:version_for_locale

Check content items for any version for locale conflicts

k exec deploy/publishing-api -- rake duplicate_content_items:version_for_locale

View source (lib/tasks/duplicate_content_items.rake)

duplicate_content_items:state_for_locale

Check content items for any state for locale conflicts

k exec deploy/publishing-api -- rake duplicate_content_items:state_for_locale

View source (lib/tasks/duplicate_content_items.rake)

duplicate_content_items:base_path_for_state

Check content items for any base path for state conflicts

k exec deploy/publishing-api -- rake duplicate_content_items:base_path_for_state

View source (lib/tasks/duplicate_content_items.rake)

heartbeat_messages:send

Send heartmessages to queue

k exec deploy/publishing-api -- rake heartbeat_messages:send

View source (lib/tasks/heartbeat_messages.rake)

metrics:report_to_prometheus

Reports metrics about data in the database to prometheus via the pushgateway

k exec deploy/publishing-api -- rake metrics:report_to_prometheus

View source (lib/tasks/metrics.rake)

pact:verify

Verify the consumer and provider pacts against this application

k exec deploy/publishing-api -- rake pact:verify

View source (lib/tasks/pact.rake)

pre_render_govspeak:render

Renders any govspeak content in the details field of live / draft editions

k exec deploy/publishing-api -- rake pre_render_govspeak:render[from_edition_id,batch_size]

View source (lib/tasks/pre_render_govspeak.rake)

pre_render_govspeak:remove

Removes any govspeak content rendered by publishing-api from the details field of live / draft editions

k exec deploy/publishing-api -- rake pre_render_govspeak:remove[from_edition_id,batch_size]

View source (lib/tasks/pre_render_govspeak.rake)

queue:watcher

Watch the queue, and print messages on the console

k exec deploy/publishing-api -- rake queue:watcher

View source (lib/tasks/queue.rake)

queue:requeue_document_type

Add live editions to the message queue by document type

k exec deploy/publishing-api -- rake queue:requeue_document_type

View source (lib/tasks/queue.rake)

queue:requeue_all_the_things

Add all live editions to the message queue with a specified routing key

k exec deploy/publishing-api -- rake queue:requeue_all_the_things[action]

View source (lib/tasks/queue.rake)

queue:requeue_all_the_ever_published_things

Add all published and unpublished editions to the message queue with a specified routing key

k exec deploy/publishing-api -- rake queue:requeue_all_the_ever_published_things[action]

View source (lib/tasks/queue.rake)

queue:requeue_all_the_published_things

Requeue all published editions with a specific routing key

k exec deploy/publishing-api -- rake queue:requeue_all_the_published_things[action]

View source (lib/tasks/queue.rake)

queue:preview_recent_message

Preview of the message published onto rabbit MQ

k exec deploy/publishing-api -- rake queue:preview_recent_message[document_type]

View source (lib/tasks/queue.rake)

regenerate_schemas

Regenerate schemas

k exec deploy/publishing-api -- rake regenerate_schemas

View source (lib/tasks/regenerate_schemas.rake)

represent_downstream:all

Represent all editions downstream

k exec deploy/publishing-api -- rake represent_downstream:all

View source (lib/tasks/represent_downstream.rake)

represent_downstream:document_type

Represent downstream for individual or multiple document_types

k exec deploy/publishing-api -- rake represent_downstream:document_type[document_types]
More about this task
Usage
rake 'represent_downstream:document_type[:document_types]'

View source (lib/tasks/represent_downstream.rake)

represent_downstream:rendering_app

Represent downstream for a rendering application

k exec deploy/publishing-api -- rake represent_downstream:rendering_app[rendering_app]
More about this task
Usage
rake 'represent_downstream:rendering_app[frontend]'

View source (lib/tasks/represent_downstream.rake)

represent_downstream:publishing_app

Represent downstream for a publishing application

k exec deploy/publishing-api -- rake represent_downstream:publishing_app[publishing_app]
More about this task
Usage
rake 'represent_downstream:publishing_app[frontend]'

View source (lib/tasks/represent_downstream.rake)

represent_downstream:content_id

Represent an individual or multiple documents downstream

k exec deploy/publishing-api -- rake represent_downstream:content_id
More about this task
Usage
rake 'represent_downstream:content_id[57a1253c-68d3-4a93-bb47-b67b9b4f6b9a]'

View source (lib/tasks/represent_downstream.rake)

represent_downstream:published_between

Represent downstream documents which were last updated in the given date

k exec deploy/publishing-api -- rake represent_downstream:published_between[start_date,end_date]
More about this task
range. The time defaults to midnight if only a date is given, so date ranges
include the start date but exclude the end date.
Usage
rake 'represent_downstream:published_between[2018-01-15, 2018-01-20]'
rake 'represent_downstream:published_between[2018-01-04T09:30:00, 2018-01-04T16:00:00]'

View source (lib/tasks/represent_downstream.rake)

represent_downstream:high_priority:content_id

Represent an individual or multiple documents downstream on the high priority

k exec deploy/publishing-api -- rake represent_downstream:high_priority:content_id
More about this task
sidekiq queue
Usage
rake 'represent_downstream:high_priority:content_id[57a1253c-68d3-4a93-bb47-b67b9b4f6b9a]'

View source (lib/tasks/represent_downstream.rake)

represent_downstream:high_priority:document_type

Represent documents by document type(s) downstream on the high_priority sidekiq

k exec deploy/publishing-api -- rake represent_downstream:high_priority:document_type[document_types]
More about this task
queue
Usage
rake 'represent_downstream:high_priority:document_type[NewsArticle]'

View source (lib/tasks/represent_downstream.rake)

sanitize_data

Sanitize access limited data

k exec deploy/publishing-api -- rake sanitize_data

View source (lib/tasks/sanitize_data.rake)

db:resolve_invalid_versions

Resolves invalid versions detected by validate:versions task

k exec deploy/publishing-api -- rake db:resolve_invalid_versions

View source (lib/tasks/sanitize_data.rake)

setup_exchange

Create RabbitMQ exchanges

k exec deploy/publishing-api -- rake setup_exchange

View source (lib/tasks/setup_exchange.rake)

special_routes:publish

Publish special routes (except the homepage)

k exec deploy/publishing-api -- rake special_routes:publish

View source (lib/tasks/special_routes.rake)

special_routes:publish_for_app

Publish all special routes for a single application

k exec deploy/publishing-api -- rake special_routes:publish_for_app[app_name]

View source (lib/tasks/special_routes.rake)

special_routes:publish_one_route

Publish a single special route

k exec deploy/publishing-api -- rake special_routes:publish_one_route[base_path]

View source (lib/tasks/special_routes.rake)

special_routes:unpublish_one_route

Unpublish a single special route, with a type of ‘gone’ or ‘redirect’

k exec deploy/publishing-api -- rake special_routes:unpublish_one_route[base_path,alternative_path]

View source (lib/tasks/special_routes.rake)

special_routes:publish_homepage

Publish the homepage

k exec deploy/publishing-api -- rake special_routes:publish_homepage

View source (lib/tasks/special_routes.rake)

update_hmrc_manual_sections

Update HMRC Manual Sections rendering app to Frontend

k exec deploy/publishing-api -- rake update_hmrc_manual_sections

View source (lib/tasks/update_hmrc_manual_sections.rake)

db:validate

Validates every record in the database

k exec deploy/publishing-api -- rake db:validate

View source (lib/tasks/validate.rake)

db:validate_versions

Validates the version sequence for all editions in the database

k exec deploy/publishing-api -- rake db:validate_versions

View source (lib/tasks/validate.rake)

validate_dist_schemas

Validate that generated schemas are valid schemas

k exec deploy/publishing-api -- rake validate_dist_schemas

View source (lib/tasks/validate_schemas.rake)

validate_examples

Validate examples against generated schemas

k exec deploy/publishing-api -- rake validate_examples

View source (lib/tasks/validate_schemas.rake)

format_examples

JSON format examples

k exec deploy/publishing-api -- rake format_examples

View source (lib/tasks/validate_schemas.rake)

validate_uniqueness_of_frontend_example_base_paths

Validate uniqueness of frontend example base paths

k exec deploy/publishing-api -- rake validate_uniqueness_of_frontend_example_base_paths[files]

View source (lib/tasks/validate_schemas.rake)

Validate links

k exec deploy/publishing-api -- rake validate_links[files]

View source (lib/tasks/validate_schemas.rake)