---
- job:
    name: content_performance_manager_import_etl_master_process
    display-name: Content Performance Manager - ETL master
    project-type: freestyle
    description: "<p>Run the etl:master rake task.</p>"
    builders:
      - shell: ssh deploy@$(govuk_node_list -c backend --single-node) "cd /var/apps/content-performance-manager && govuk_setenv content-performance-manager bundle exec rake etl:master"
    wrappers:
      - ansicolor:
          colormap: xterm
    publishers:
      - email:
          recipients: govuk-ci-notifications@digital.cabinet-office.gov.uk
  <% if @rake_etl_master_process_cron_schedule %>
    triggers:
      - timed: <%= @rake_etl_master_process_cron_schedule %>
  <% end %>
    logrotate:
        numToKeep: 10
    publishers:
      - trigger-parameterized-builds:
          - project: Success_Passive_Check
            condition: 'SUCCESS'
            predefined-parameters: |
                NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                NSCA_OUTPUT=<%= @service_description %> success
          - project: Failure_Passive_Check
            condition: 'FAILED'
            predefined-parameters: |
                NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                NSCA_OUTPUT=<%= @service_description %> failed
                NSCA_CODE=2


---
- job:
    name: content_performance_manager_import_etl_master_process
    display-name: Content Performance Manager - ETL master
    project-type: freestyle
    description: "<p>Run the etl:master rake task.</p>"
    builders:
      - trigger-builds:
          - project: run-rake-task
            block: true
            predefined-parameters: |
              TARGET_APPLICATION=content-performance-manager
              MACHINE_CLASS=backend
              RAKE_TASK=etl:master
    wrappers:
      - ansicolor:
          colormap: xterm
    publishers:
      - email:
          recipients: govuk-ci-notifications@digital.cabinet-office.gov.uk
  <% if @rake_etl_master_process_cron_schedule %>
    triggers:
      - timed: <%= @rake_etl_master_process_cron_schedule %>
  <% end %>
    logrotate:
        numToKeep: 10
    publishers:
      - trigger-parameterized-builds:
          - project: Success_Passive_Check
            condition: 'SUCCESS'
            predefined-parameters: |
                NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                NSCA_OUTPUT=<%= @service_description %> success
          - project: Failure_Passive_Check
            condition: 'FAILED'
            predefined-parameters: |
                NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                NSCA_OUTPUT=<%= @service_description %> failed
                NSCA_CODE=2


Use run-rake-task in content-performance-manager jobs
Use run-rake-task in content-performance-manager jobs
