<commit_before>---
- scm:
    name: env-sync-and-backup_Copy_Data_to_Integration
    scm:
        - git:
            url: <EMAIL>:alphagov/env-sync-and-backup.git
            branches:
              - master

- job:
    name: Copy_Data_to_Integration
    display-name: Copy_Data_to_Integration
    project-type: freestyle
    description: |
        This job copies databases from production to integration. It runs periodically
        to keep the integration environment up to date. The signon database isn't copied.
    properties:
        - github:
            url: https://github.com/alphagov/env-sync-and-backup/
        - inject:
            properties-content: |
              PARALLEL_JOBS=3
        - build-discarder:
            days-to-keep: 30
            artifact-num-to-keep: 5
        - slack:
            notify-start: false
            notify-success: true
            notify-aborted: true
            notify-notbuilt: true
            notify-unstable: false
            notify-failure: true
            notify-backtonormal: false
            notify-repeatedfailure: false
            include-test-summary: false
            room: <%= @slack_room %>
    scm:
      - env-sync-and-backup_Copy_Data_to_Integration
    logrotate:
        numToKeep: 10
    triggers:
        - timed: 'H 4 * * 1-5'
    builders:
        - shell: |
            set -eu

            cd "${WORKSPACE}"

            echo "Putting in the real MySQL root password"
            sed -i.bak "s/MYSQL_SRC_ROOT_PW=PLACEHOLDER/MYSQL_SRC_ROOT_PW='<%= @mysql_src_root_pw %>'/g" scripts/sync-mysql.sh
            sed -i "s/MYSQL_DST_ROOT_PW=PLACEHOLDER/MYSQL_DST_ROOT_PW='<%= @mysql_dst_root_pw %>'/g" scripts/sync-mysql.sh

            echo "Putting in the real PostgreSQL env-sync password"
            sed -i.bak "s/PG_SRC_ENV_SYNC_PW=PLACEHOLDER/PG_SRC_ENV_SYNC_PW='<%= @pg_src_env_sync_pw %>'/" scripts/sync-postgresql.sh
            sed -i "s/PG_DST_ENV_SYNC_PW=PLACEHOLDER/PG_DST_ENV_SYNC_PW='<%= @pg_dst_env_sync_pw %>'/" scripts/sync-postgresql.sh
            sed -i "s/PG_DST_ENV_SYNC_PW=TR_PLACEHOLDER/PG_DST_ENV_SYNC_PW='<%= @pg_tr_dst_env_sync_pw %>'/" scripts/sync-postgresql.sh

            echo "Syncing data"
            bash sync production integration
    publishers:<commit_msg>Set transition authentication in integration<commit_after>---
- scm:
    name: env-sync-and-backup_Copy_Data_to_Integration
    scm:
        - git:
            url: <EMAIL>:alphagov/env-sync-and-backup.git
            branches:
              - master

- job:
    name: Copy_Data_to_Integration
    display-name: Copy_Data_to_Integration
    project-type: freestyle
    description: |
        This job copies databases from production to integration. It runs periodically
        to keep the integration environment up to date. The signon database isn't copied.
    properties:
        - github:
            url: https://github.com/alphagov/env-sync-and-backup/
        - inject:
            properties-content: |
              PARALLEL_JOBS=3
        - build-discarder:
            days-to-keep: 30
            artifact-num-to-keep: 5
        - slack:
            notify-start: false
            notify-success: true
            notify-aborted: true
            notify-notbuilt: true
            notify-unstable: false
            notify-failure: true
            notify-backtonormal: false
            notify-repeatedfailure: false
            include-test-summary: false
            room: <%= @slack_room %>
    scm:
      - env-sync-and-backup_Copy_Data_to_Integration
    logrotate:
        numToKeep: 10
    triggers:
        - timed: 'H 4 * * 1-5'
    builders:
        - shell: |
            set -eu

            cd "${WORKSPACE}"

            echo "Putting in the real MySQL root password"
            sed -i.bak "s/MYSQL_SRC_ROOT_PW=PLACEHOLDER/MYSQL_SRC_ROOT_PW='<%= @mysql_src_root_pw %>'/g" scripts/sync-mysql.sh
            sed -i "s/MYSQL_DST_ROOT_PW=PLACEHOLDER/MYSQL_DST_ROOT_PW='<%= @mysql_dst_root_pw %>'/g" scripts/sync-mysql.sh

            echo "Putting in the real PostgreSQL env-sync password"
            sed -i.bak "s/PG_SRC_ENV_SYNC_PW=PLACEHOLDER/PG_SRC_ENV_SYNC_PW='<%= @pg_src_env_sync_pw %>'/" scripts/sync-postgresql.sh
            sed -i "s/PG_DST_ENV_SYNC_PW=PLACEHOLDER/PG_DST_ENV_SYNC_PW='<%= @pg_dst_env_sync_pw %>'/" scripts/sync-postgresql.sh
            sed -i "s/PG_DST_ENV_SYNC_PW=TR_PLACEHOLDER/PG_DST_ENV_SYNC_PW='<%= @pg_tr_dst_env_sync_pw %>'/" scripts/sync-postgresql.sh

            echo "Putting in the real Transition Postgresql transition password"
            sed -i.bak "s/PG_TR_SRC_ENV_SYNC_PW=PLACEHOLDER/PG_TR_SRC_ENV_SYNC_PW='<%= @pg_src_env_sync_pw %>'/" scripts/sync-transition-postgresql.sh
            sed -i "s/PG_TR_DST_ENV_SYNC_PW=PLACEHOLDER/PG_TR_DST_ENV_SYNC_PW='<%= @pg_tr_dst_env_sync_pw %>'/" scripts/sync-transition-postgresql.sh

            echo "Syncing data"
            bash sync production integration
    publishers:
{'fraction_non_alphanumeric': 0.0999597747385358, 'fraction_numerical': 0.0036202735317779565, 'mean_word_length': 2.1514575411913817, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 2, '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': '3021567', 'n_tokens_mistral': 1734, 'n_tokens_neox': 1669, 'n_words': 306}