---
- job:
    name: integration-router-data-deploy
    display-name: integration-router-data-deploy
    project-type: freestyle
    description: "Kicks off a router-data deploy in the Integration environment"
    builders:
      - shell: |
          JSON="{\"parameter\": [{\"name\": \"TAG\", \"value\": \"$TAG\"}], \"\": \"\"}"

          # Deploy to integration environment
          echo curl -f -XPOST https://<%= @jenkins_integration_api_user %>:<%= @jenkins_integration_api_password %>@deploy.integration.publishing.service.gov.uk/job/deploy_router_data/build --data-urlencode json="$JSON"
    wrappers:
        - ansicolor:
            colormap: xterm
    parameters:
        - string:
            name: TAG
            description: 'Git tag/committish to deploy.'
            default: 'release'
    publishers:
        - email:
            recipients: govuk-ci-notifications@digital.cabinet-office.gov.uk
            send-to-individuals: true

---
- job:
    name: integration-router-data-deploy
    display-name: integration-router-data-deploy
    project-type: freestyle
    description: "Kicks off a router-data deploy in the Integration environment"
    builders:
      - shell: |
          JSON="{\"parameter\": [{\"name\": \"TAG\", \"value\": \"$TAG\"}], \"\": \"\"}"

          # Deploy to integration environment
          CRUMB=$(curl https://<%= @jenkins_integration_api_user %>:<%= @jenkins_integration_api_password %>@deploy.integration.publishing.service.gov.uk/crumbIssuer/api/json | jq --raw-output '. | .crumb')
          curl -f -H "Jenkins-Crumb:$CRUMB" -XPOST https://<%= @jenkins_integration_api_user %>:<%= @jenkins_integration_api_password %>@deploy.integration.publishing.service.gov.uk/job/deploy_router_data/build --data-urlencode json="$JSON"
    wrappers:
        - ansicolor:
            colormap: xterm
    parameters:
        - string:
            name: TAG
            description: 'Git tag/committish to deploy.'
            default: 'release'
    publishers:
        - email:
            recipients: govuk-ci-notifications@digital.cabinet-office.gov.uk
            send-to-individuals: true

Make the integration_router_data_deploy job actually do something
Make the integration_router_data_deploy job actually do something

When this was added in 3fa8e443ed7a6b1117adcf0429c25da338967596 the job
only `echo`ed the curl to deploy.integration rather than actually calling
it.  This means the job is a no-op and doesn't actually trigger the
deploy.  We remove the echo so it does trigger the deploy and while we're
at it we also add the CRUMB stuff added to the integration_deploy_app job
in #6585.
