---
- job:
    name: search_reindex_with_new_schema
    display-name: Search reindex with new schema
    project-type: freestyle
    description: |
      Rebuild new search indexes with up to date settings and mappings, and reindex all content from the existing indexes.
    logrotate:
      numToKeep: 10
<% if @cron_schedule %>
    triggers:
        - timed: '<%= @cron_schedule %>'
<% end %>
    properties:
      - build-discarder:
          days-to-keep: 30
          artifact-num-to-keep: 5
    builders:
      - trigger-builds:
          - project: run-rake-task
            block: true
            predefined-parameters: |
              TARGET_APPLICATION=rummager
              MACHINE_CLASS=search
              RAKE_TASK="rummager:migrate_schema CONFIRM_INDEX_MIGRATION_START=1 RUMMAGER_INDEX=all"
    wrappers:
      - ansicolor:
          colormap: xterm
      - timestamps

---
- job:
    name: search_reindex_with_new_schema
    display-name: Search reindex with new schema
    project-type: freestyle
    description: |
      Rebuild new search indexes with up to date settings and mappings, and reindex all content from the existing indexes.
    logrotate:
      numToKeep: 10
<% if @cron_schedule %>
    triggers:
        - timed: '<%= @cron_schedule %>'
<% end %>
    properties:
      - build-discarder:
          days-to-keep: 30
          artifact-num-to-keep: 5
    builders:
        - shell: ssh deploy@$(govuk_node_list -c search --single-node) "cd /var/apps/rummager && govuk_setenv rummager bundle exec rake rummager:migrate_schema CONFIRM_INDEX_MIGRATION_START=1 RUMMAGER_INDEX=all"
    wrappers:
      - ansicolor:
          colormap: xterm
      - timestamps

Revert "Use run-rake-task in search_reindex_with_new_schema job"
Revert "Use run-rake-task in search_reindex_with_new_schema job"

This reverts commit 1254a68e5c718169b1fc1bf77c941d91fbf8fb41.
