---
- job:
    name: whitehall_run_broken_link_checker
    display-name: whitehall_run_broken_link_checker
    project-type: freestyle
    description: "<p>Triggers the broken link checker rake task on whitehall-backend-1.</p>"
    builders:
        - shell: |
        <%- if scope.lookupvar('::aws_migration') %>
        ssh deploy@$(govuk_node_list -c whitehall_backend --single-node) '
        <%- else -%>
        ssh deploy@whitehall-backend-1.backend '
        <%- end -%>
        cd /var/apps/whitehall; govuk_setenv whitehall nohup bundle exec rake generate_broken_link_reports[/tmp/bad_link_reports,second-line-content@digital.cabinet-office.gov.uk]'
            echo "Broken link checker run"
    triggers:
        - timed: '0 2 1 * *'
    wrappers:
        - ansicolor:
            colormap: xterm
    publishers:
        - email:
            recipients: govuk-ci-notifications@digital.cabinet-office.gov.uk
        - trigger-parameterized-builds:
            - project: success_passive_check
              condition: 'SUCCESS'
              predefined-parameters: |
                  NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                  NSCA_OUTPUT=<%= @service_description %> successful
            - project: failure_passive_check
              condition: 'FAILED'
              predefined-parameters: |
                  NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                  NSCA_OUTPUT=<%= @service_description %> failed
    logrotate:
        numToKeep: 10


---
- job:
    name: whitehall_run_broken_link_checker
    display-name: whitehall_run_broken_link_checker
    project-type: freestyle
    description: "<p>Triggers the broken link checker rake task on whitehall-backend-1.</p>"
    builders:
        - shell: |
            ssh deploy@$(govuk_node_list -c whitehall_backend --single-node) 'cd /var/apps/whitehall; govuk_setenv whitehall nohup bundle exec rake generate_broken_link_reports[/tmp/bad_link_reports,second-line-content@digital.cabinet-office.gov.uk]'
            echo "Broken link checker run"
    triggers:
        - timed: '0 2 1 * *'
    wrappers:
        - ansicolor:
            colormap: xterm
    publishers:
        - email:
            recipients: govuk-ci-notifications@digital.cabinet-office.gov.uk
        - trigger-parameterized-builds:
            - project: success_passive_check
              condition: 'SUCCESS'
              predefined-parameters: |
                  NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                  NSCA_OUTPUT=<%= @service_description %> successful
            - project: failure_passive_check
              condition: 'FAILED'
              predefined-parameters: |
                  NSCA_CHECK_DESCRIPTION=<%= @service_description %>
                  NSCA_OUTPUT=<%= @service_description %> failed
    logrotate:
        numToKeep: 10


Remove conditional from the broken link checker job
Remove conditional from the broken link checker job

The indentation and position of the command is wrong. Rather than
trying to figure out how to layout the erb, lets try removing the
conditional and changing the behaviour not to specify a machine. I've
had a quick look at the rake task being run, and it doesn't look to be
machine dependant.
