---
- job:
    name: record-taxonomy-metrics
    display-name: Record metrics about the Topic Taxonomy
    project-type: freestyle
    description: |
      This job runs a rake task in Content Tagger to send metrics
      about the Topic Taxonomy to statsd.
    logrotate:
      daysToKeep: 30
    triggers:
      - timed: 'H/30 * * * *'
    properties:
      - build-discarder:
          days-to-keep: 30
          artifact-num-to-keep: 5
    builders:
      - shell: |
          #!/bin/bash
          set -eu

          cd "${WORKSPACE}"

          CONTENT_TAGGER=$(govuk_node_list --single-node -c backend)

          ssh deploy@$CONTENT_TAGGER "cd /var/apps/content-tagger && govuk_setenv content-tagger bundle exec rake metrics:taxonomy:record_all"

---
- job:
    name: record-taxonomy-metrics
    display-name: Record metrics about the Topic Taxonomy
    project-type: freestyle
    description: |
      This job runs a rake task in Content Tagger to send metrics
      about the Topic Taxonomy to statsd.
    logrotate:
      daysToKeep: 30
    triggers:
      - timed: 'H/30 * * * *'
    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=content-tagger
              MACHINE_CLASS=backend
              RAKE_TASK=metrics:taxonomy:record_all

Use run-rake-task in record-taxonomy-metrics job
Use run-rake-task in record-taxonomy-metrics job
