<commit_before>---
- job:
    name: integration-app-deploy
    display-name: integration-app-deploy
    project-type: freestyle
    description: "Kicks off an appliction deploy in the Integration environment"
    builders:
      - shell: |
          JSON="{\"parameter\": [{\"name\": \"TARGET_APPLICATION\", \"value\": \"$TARGET_APPLICATION\"}, {\"name\": \"TAG\", \"value\": \"$TAG\"}, {\"name\": \"DEPLOY_TASK\", \"value\": \"$DEPLOY_TASK\"}], \"\": \"\"}"

          # Deploy to integration environment
          CRUMB=$(curl https://<%= @jenkins_integration_api_user %>:<%= @jenkins_integration_api_password %>@<EMAIL>/crumbIssuer/api/json | jq --raw-output '. | .crumb')
          curl -f -H "Jenkins-Crumb:$CRUMB" -XPOST https://<%= @jenkins_integration_api_user %>:<%= @jenkins_integration_api_password %>@<EMAIL>/job/Deploy_App/build --data-urlencode json="$JSON"

          # Deploy to AWS Integration environment
          CRUMB=$(curl https://<%= @jenkins_integration_aws_api_user %>:<%= @jenkins_integration_aws_api_password %>@<%= @aws_deploy_url %>/crumbIssuer/api/json | jq '. | .crumb' | sed 's/"//g"')
          curl -f -H "Jenkins-Crumb:$CRUMB" -XPOST https://<%= @jenkins_integration_aws_api_user %>:<%= @jenkins_integration_aws_api_password %>@<%= @aws_deploy_url %>/job/Deploy_App/build --data-urlencode json="$JSON"
    wrappers:
        - ansicolor:
            colormap: xterm
    parameters:
        - choice:
            name: TARGET_APPLICATION
            description: 'Application to deploy'
            choices: <%= ['-- Choose an app'] + @applications.keys %>
        - string:
            name: TAG
            description: 'Git tag/committish to deploy.'
            default: 'release'
        - choice:
            name: DEPLOY_TASK
            description: 'Task to run (available as $DEPLOY_TASK to deploy.sh and passed explicitly to Capistrano).'
            choices:
              - deploy
              - deploy:migrations
              - deploy:setup
    publishers:
        - description-setter:
            regexp: ""
            description: "$TARGET_APPLICATION $TAG"
        - email:
            recipients: <EMAIL>
            send-to-individuals: true
<commit_msg>Switch to using jq --raw-output rather than sed<commit_after>---
- job:
    name: integration-app-deploy
    display-name: integration-app-deploy
    project-type: freestyle
    description: "Kicks off an appliction deploy in the Integration environment"
    builders:
      - shell: |
          JSON="{\"parameter\": [{\"name\": \"TARGET_APPLICATION\", \"value\": \"$TARGET_APPLICATION\"}, {\"name\": \"TAG\", \"value\": \"$TAG\"}, {\"name\": \"DEPLOY_TASK\", \"value\": \"$DEPLOY_TASK\"}], \"\": \"\"}"

          # Deploy to integration environment
          CRUMB=$(curl https://<%= @jenkins_integration_api_user %>:<%= @jenkins_integration_api_password %>@<EMAIL>.uk/crumbIssuer/api/json | jq --raw-output '. | .crumb')
          curl -f -H "Jenkins-Crumb:$CRUMB" -XPOST https://<%= @jenkins_integration_api_user %>:<%= @jenkins_integration_api_password %>@<EMAIL>/job/Deploy_App/build --data-urlencode json="$JSON"

          # Deploy to AWS Integration environment
          CRUMB=$(curl https://<%= @jenkins_integration_aws_api_user %>:<%= @jenkins_integration_aws_api_password %>@<%= @aws_deploy_url %>/crumbIssuer/api/json | jq --raw-output '. | .crumb')
          curl -f -H "Jenkins-Crumb:$CRUMB" -XPOST https://<%= @jenkins_integration_aws_api_user %>:<%= @jenkins_integration_aws_api_password %>@<%= @aws_deploy_url %>/job/Deploy_App/build --data-urlencode json="$JSON"
    wrappers:
        - ansicolor:
            colormap: xterm
    parameters:
        - choice:
            name: TARGET_APPLICATION
            description: 'Application to deploy'
            choices: <%= ['-- Choose an app'] + @applications.keys %>
        - string:
            name: TAG
            description: 'Git tag/committish to deploy.'
            default: 'release'
        - choice:
            name: DEPLOY_TASK
            description: 'Task to run (available as $DEPLOY_TASK to deploy.sh and passed explicitly to Capistrano).'
            choices:
              - deploy
              - deploy:migrations
              - deploy:setup
    publishers:
        - description-setter:
            regexp: ""
            description: "$TARGET_APPLICATION $TAG"
        - email:
            recipients: <EMAIL>
            send-to-individuals: true

{'fraction_non_alphanumeric': 0.15552064631956913, 'fraction_numerical': 0.0, 'mean_word_length': 2.4127105666156203, 'pattern_counts': {'":': 16, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1089186', 'n_tokens_mistral': 1433, 'n_tokens_neox': 1348, 'n_words': 290}