<commit_before>---
- job:
    name: Data_Sync_Complete
    display-name: Data_Sync_Complete
    project-type: freestyle
    description: "Run after data is synced from production."
    <%- if @auth_token -%>
    auth-token: <%= @auth_token %>
    <%- end -%>
    logrotate:
      numToKeep: 10
    properties:
      - build-discarder:
          days-to-keep: 30
          artifact-num-to-keep: 5
    builders:
       - shell: |
           # Clear the Sidekiq queues to stop any residual 'stale' jobs running
           <%- if scope.lookupvar('::aws_migration') %>
           ssh deploy@$(govuk_node_list -c backend --single-node) 'redis-cli -h backend-redis flushall'
           <%- else %>
           for host in $(govuk_node_list -c redis); do
              ssh deploy@${host} 'redis-cli flushall'
           done
           <%- end %>
           # Queue up any publisher scheduled editions that have been transferred across.
           ssh deploy@$(govuk_node_list -c backend --single-node) 'cd /var/apps/publisher ; govuk_setenv publisher bundle exec rake editions:requeue_scheduled_for_publishing'
           # Publish any pre-production finders from Specialist Publisher.
           ssh deploy@$(govuk_node_list -c backend --single-node) 'cd /var/apps/specialist-publisher ; govuk_setenv specialist-publisher bundle exec rake publishing_api:publish_finders'
    publishers:
        - trigger-parameterized-builds:
            <%- %w{ publishing-api collections-publisher service-manual-publisher local-links-manager email-alert-api transition link-checker-api content-performance-manager content-tagger content-publisher }.each do |app| -%>
            - project: Deploy_App
              predefined-parameters: |
                TARGET_APPLICATION=<%= app %>
                DEPLOY_TASK=app:migrate_and_hard_restart
            <%- end -%>
            - project: run-rake-task
              predefined-parameters: |
                TARGET_APPLICATION=whitehall
                MACHINE_CLASS=whitehall_backend
                RAKE_TASK=publishing:scheduled:requeue_all_jobs
        - email:
            recipients: <EMAIL><commit_msg>Fix integr. Data Sync Complete Jenkins job script<commit_after>---
- job:
    name: Data_Sync_Complete
    display-name: Data_Sync_Complete
    project-type: freestyle
    description: "Run after data is synced from production."
    <%- if @auth_token -%>
    auth-token: <%= @auth_token %>
    <%- end -%>
    logrotate:
      numToKeep: 10
    properties:
      - build-discarder:
          days-to-keep: 30
          artifact-num-to-keep: 5
    builders:
       - shell: |
           # Clear the Sidekiq queues to stop any residual 'stale' jobs running
           <%- if scope.lookupvar('::aws_migration') %>
           ssh deploy@$(govuk_node_list -c backend --single-node) 'redis-cli -h backend-redis flushall'
           <%- else %>
           for host in $(govuk_node_list -c redis); do
              ssh deploy@${host} 'redis-cli flushall'
           done
           <%- end %>
           # Fix signon application hostnames
           ssh deploy@$(govuk_node_list -c backend --single-node) 'cd /var/apps/signon && OLD_DOMAIN=publishing.service.gov.uk NEW_DOMAIN=integration.publishing.service.gov.uk govuk_setenv signon bundle exec rake applications:migrate_domain'
           ssh deploy@$(govuk_node_list -c backend --single-node) 'cd /var/apps/signon && OLD_DOMAIN=performance.service.gov.uk NEW_DOMAIN=integration.performance.service.gov.uk govuk_setenv signon bundle exec rake applications:migrate_domain'
           ssh deploy@$(govuk_node_list -c backend --single-node) 'cd /var/apps/signon && OLD_DOMAIN=-production.cloudapps.digital NEW_DOMAIN=-integration.cloudapps.digital govuk_setenv signon bundle exec rake applications:migrate_domain'
           # Queue up any whitehall scheduled editions that have been transferred across.
           ssh deploy@$(govuk_node_list -c whitehall_backend --single-node) 'cd /var/apps/whitehall ; govuk_setenv whitehall bundle exec rake publishing:scheduled:requeue_all_jobs'
           # Queue up any publisher scheduled editions that have been transferred across.
           ssh deploy@$(govuk_node_list -c backend --single-node) 'cd /var/apps/publisher ; govuk_setenv publisher bundle exec rake editions:requeue_scheduled_for_publishing'
    publishers:
        - trigger-parameterized-builds:
            <%- %w{ publishing-api collections-publisher service-manual-publisher local-links-manager email-alert-api transition link-checker-api content-performance-manager content-tagger content-publisher }.each do |app| -%>
            - project: Deploy_App
              predefined-parameters: |
                TARGET_APPLICATION=<%= app %>
                DEPLOY_TASK=app:migrate_and_hard_restart
            <%- end -%>
            - project: run-rake-task
              predefined-parameters: |
                TARGET_APPLICATION=whitehall
                MACHINE_CLASS=whitehall_backend
                RAKE_TASK=publishing:scheduled:requeue_all_jobs
        - email:
            recipients: <EMAIL>
{'fraction_non_alphanumeric': 0.09652736904061213, 'fraction_numerical': 0.001961938395134393, 'mean_word_length': 2.48224043715847, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '681805', 'n_tokens_mistral': 1563, 'n_tokens_neox': 1471, 'n_words': 347}