---
- job:
    name: Run_Whitehall_Data_Migrations
    display-name: Run_Whitehall_Data_Migrations
    project-type: freestyle
    description: "This job SSHes onto a whitehall-backend node and runs 'cd /var/apps/whitehall ; RAILS_ENV=production bundle exec rake db:data:migrate'"
    properties:
      - build-discarder:
          days-to-keep: 30
          artifact-num-to-keep: 5
    builders:
        - shell: |
            ssh deploy@$(govuk_node_list -c whitehall_backend --single-node) "cd /var/apps/whitehall ; govuk_setenv whitehall bundle exec rake db:data:migrate"
    wrappers:
        - ansicolor:
            colormap: xterm
        - timestamps

---
- job:
    name: Run_Whitehall_Data_Migrations
    display-name: Run_Whitehall_Data_Migrations
    project-type: freestyle
    description: "This job SSHes onto a whitehall-backend node and runs 'cd /var/apps/whitehall ; RAILS_ENV=production bundle exec rake db:data:migrate'"
    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=whitehall
              MACHINE_CLASS=whitehall_backend
              RAKE_TASK=db:data:migrate
    wrappers:
        - ansicolor:
            colormap: xterm
        - timestamps

Use run-rake-task in Run_Whitehall_Data_Migrations job
Use run-rake-task in Run_Whitehall_Data_Migrations job
