<commit_before># Ignore everything except changes to the toolchain files
ignore:
    - "*"
    - "!/.evergreen/toolchain/*"

stepback: false

# FUNCTIONS
functions:
  "fetchSource" :
    command: git.get_project
    params:
      directory: mongo-perl-driver
  "makeWorkDir":
    command: shell.exec
    params:
      script: |
        set -o errexit
        set -o verbose
        mkdir perl-toolchain
  "buildUnixPerls":
    command: shell.exec
    params:
      working_dir: perl-toolchain
      script: |
        set -o errexit
        set -o verbose
        ../mongo-perl-driver/.evergreen/toolchain/build-unix-perls.pl
  "buildWinPerls":
    command: shell.exec
    params:
      working_dir: perl-toolchain
      script: |
        set -o errexit
        set -o verbose
        ../mongo-perl-driver/.evergreen/toolchain/build-win-perls.pl
  "uploadToolchain":
    command: s3.put
    params:
      aws_key: ${aws_key}
      aws_secret: ${aws_secret}
      local_file: perl-toolchain/perl.tar.gz
      remote_file: ${aws_prefix}/${build_variant}/${revision}/${build_id}.tar.gz
      bucket: mciuploads
      permissions: public-read
      content_type: ${content_type|application/x-gzip}
  "uploadTaskLog":
    command: s3.put
    params:
      aws_key: ${aws_key}
      aws_secret: ${aws_secret}
      local_file: perl-toolchain/task-logs.tar.gz
      remote_file: ${aws_prefix}/${version_id}/${build_id}/${task_name}_${execution}/task-logs.tar.gz
      bucket: mciuploads
      permissions: public-read
      optional: true
      content_type: application/x-gzip
  "downloadToolchain" :
    command: shell.exec
    params:
      working_dir: "perl-toolchain"
      script: |
        set -o errexit
        set -o verbose
        curl https://s3.amazonaws.com/mciuploads/${aws_prefix}/${build_variant}/${revision}/${build_id}.tar.gz -o perl.tar.gz --silent --max-time 240
        tar -zxf perl.tar.gz
  "validateUnixToolchain" :
    command: shell.exec
    params:
      working_dir: "perl-toolchain"
      script: |
        set -o errexit
        set -o verbose
        ../mongo-perl-driver/.evergreen/toolchain/validate-unix-perls.sh
  "validateWinToolchain" :
    command: shell.exec
    params:
      working_dir: "perl-toolchain"
      script: |
        set -o errexit
        set -o verbose
        dos2unix ../mongo-perl-driver/.evergreen/toolchain/validate-win-perls.sh
        ../mongo-perl-driver/.evergreen/toolchain/validate-win-perls.sh
  "copyToolchainToBoxes":
    command: s3Copy.copy
    params:
      aws_key: ${aws_key}
      aws_secret: ${aws_secret}
      s3_copy_files:
        - { 'source': { 'path': '${aws_prefix}/${build_variant}/${revision}/${build_id}.tar.gz', 'bucket': 'mciuploads' },
            'destination': { 'path': 'build/toolchain-drivers/mongo-perl-driver/perl-toolchain-${build_variant}-${revision}.tar.gz', 'bucket': 'boxes.10gen.com' }
          }
  "cleanUp":
    command: shell.exec
    params:
      script: |
        set -o errexit
        set -o verbose
        rm -rf mongo-perl-driver
        rm -rf perl-toolchain

# PRE/POST TASKS
pre:
  - func: cleanUp
  - func: fetchSource
  - func: makeWorkDir

post:
  - func: uploadTaskLog
  - func: cleanUp

# TASK DEFINITIONS
tasks:
  - name: build-unix-perls
    commands:
      - func: buildUnixPerls
      - func: uploadToolchain

  - name: validate-unix-perls
    depends_on:
    - name: build-unix-perls
    commands:
      - func: downloadToolchain
      - func: validateUnixToolchain

  - name: build-win-perls
    commands:
      - func: buildWinPerls
      - func: uploadToolchain

  - name: validate-win-perls
    depends_on:
    - name: build-win-perls
    commands:
      - func: downloadToolchain
      - func: validateWinToolchain

  - name: push-unix-perls
    depends_on:
    - name: validate-unix-perls
    stepback: false
    commands:
      - func: copyToolchainToBoxes

  - name: push-win-perls
    depends_on:
    - name: validate-win-perls
    stepback: false
    commands:
      - func: copyToolchainToBoxes

# BUILD VARIANTS

# Amazon

buildvariants:
- name: amazon-v1
  display_name: Amazon v1 x86_64
  run_on:
    - linux-64-amzn-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: amazon-v2
  display_name: Amazon v2 x86_64
  run_on:
    - amazon2-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

# Debian

- name: debian81
  display_name: Debian 8.1 x86_64
  run_on:
    - debian81-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: debian92
  display_name: Debian 9.2 x86_64
  run_on:
    - debian92-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

# RedHat

- name: rhel62
  display_name: RedHat 6.2 x86_64
  run_on:
    - rhel62-large
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: rhel70
  display_name: RedHat 7.0 x86_64
  run_on:
    - rhel70
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

# SUSE

- name: suse12
  display_name: SUSE 12 x86_64
  run_on:
    - suse12-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

# Ubuntu

- name: ubuntu1404
  display_name: Ubuntu 14.04 x86_64
  run_on:
    - ubuntu1404-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: ubuntu1604
  display_name: Ubuntu 16.04 x86_64
  run_on:
    - ubuntu1604-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: ubuntu1804
  display_name: Ubuntu 18.04 x86_64
  run_on:
    - ubuntu1804-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

# Windows

- name: windows64
  display_name: Windows64
  run_on:
    - windows-64-vs2015-test
  tasks:
    - build-win-perls
    - validate-win-perls
    - push-win-perls

# ZAP

- name: rhel67-zseries
  display_name: ZAP RedHat 6.7 Z Series
  run_on:
    - rhel67-zseries-test
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: ubuntu1604-arm64
  display_name: ZAP Ubuntu 16.04 ARM64
  run_on:
    - ubuntu1604-arm64-large
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: rhel71-power8
  display_name: ZAP RedHat 7.1 Power8
  run_on:
    - rhel71-power8-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: ubuntu1604-power8
  display_name: ZAP Ubuntu 16.04 Power8
  run_on:
    - ubuntu1604-power8-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls
<commit_msg>minor: CI: remove Amazon Linux v1 from Perl toolchain builds<commit_after># Ignore everything except changes to the toolchain files
ignore:
    - "*"
    - "!/.evergreen/toolchain/*"

stepback: false

# FUNCTIONS
functions:
  "fetchSource" :
    command: git.get_project
    params:
      directory: mongo-perl-driver
  "makeWorkDir":
    command: shell.exec
    params:
      script: |
        set -o errexit
        set -o verbose
        mkdir perl-toolchain
  "buildUnixPerls":
    command: shell.exec
    params:
      working_dir: perl-toolchain
      script: |
        set -o errexit
        set -o verbose
        ../mongo-perl-driver/.evergreen/toolchain/build-unix-perls.pl
  "buildWinPerls":
    command: shell.exec
    params:
      working_dir: perl-toolchain
      script: |
        set -o errexit
        set -o verbose
        ../mongo-perl-driver/.evergreen/toolchain/build-win-perls.pl
  "uploadToolchain":
    command: s3.put
    params:
      aws_key: ${aws_key}
      aws_secret: ${aws_secret}
      local_file: perl-toolchain/perl.tar.gz
      remote_file: ${aws_prefix}/${build_variant}/${revision}/${build_id}.tar.gz
      bucket: mciuploads
      permissions: public-read
      content_type: ${content_type|application/x-gzip}
  "uploadTaskLog":
    command: s3.put
    params:
      aws_key: ${aws_key}
      aws_secret: ${aws_secret}
      local_file: perl-toolchain/task-logs.tar.gz
      remote_file: ${aws_prefix}/${version_id}/${build_id}/${task_name}_${execution}/task-logs.tar.gz
      bucket: mciuploads
      permissions: public-read
      optional: true
      content_type: application/x-gzip
  "downloadToolchain" :
    command: shell.exec
    params:
      working_dir: "perl-toolchain"
      script: |
        set -o errexit
        set -o verbose
        curl https://s3.amazonaws.com/mciuploads/${aws_prefix}/${build_variant}/${revision}/${build_id}.tar.gz -o perl.tar.gz --silent --max-time 240
        tar -zxf perl.tar.gz
  "validateUnixToolchain" :
    command: shell.exec
    params:
      working_dir: "perl-toolchain"
      script: |
        set -o errexit
        set -o verbose
        ../mongo-perl-driver/.evergreen/toolchain/validate-unix-perls.sh
  "validateWinToolchain" :
    command: shell.exec
    params:
      working_dir: "perl-toolchain"
      script: |
        set -o errexit
        set -o verbose
        dos2unix ../mongo-perl-driver/.evergreen/toolchain/validate-win-perls.sh
        ../mongo-perl-driver/.evergreen/toolchain/validate-win-perls.sh
  "copyToolchainToBoxes":
    command: s3Copy.copy
    params:
      aws_key: ${aws_key}
      aws_secret: ${aws_secret}
      s3_copy_files:
        - { 'source': { 'path': '${aws_prefix}/${build_variant}/${revision}/${build_id}.tar.gz', 'bucket': 'mciuploads' },
            'destination': { 'path': 'build/toolchain-drivers/mongo-perl-driver/perl-toolchain-${build_variant}-${revision}.tar.gz', 'bucket': 'boxes.10gen.com' }
          }
  "cleanUp":
    command: shell.exec
    params:
      script: |
        set -o errexit
        set -o verbose
        rm -rf mongo-perl-driver
        rm -rf perl-toolchain

# PRE/POST TASKS
pre:
  - func: cleanUp
  - func: fetchSource
  - func: makeWorkDir

post:
  - func: uploadTaskLog
  - func: cleanUp

# TASK DEFINITIONS
tasks:
  - name: build-unix-perls
    commands:
      - func: buildUnixPerls
      - func: uploadToolchain

  - name: validate-unix-perls
    depends_on:
    - name: build-unix-perls
    commands:
      - func: downloadToolchain
      - func: validateUnixToolchain

  - name: build-win-perls
    commands:
      - func: buildWinPerls
      - func: uploadToolchain

  - name: validate-win-perls
    depends_on:
    - name: build-win-perls
    commands:
      - func: downloadToolchain
      - func: validateWinToolchain

  - name: push-unix-perls
    depends_on:
    - name: validate-unix-perls
    stepback: false
    commands:
      - func: copyToolchainToBoxes

  - name: push-win-perls
    depends_on:
    - name: validate-win-perls
    stepback: false
    commands:
      - func: copyToolchainToBoxes

# BUILD VARIANTS

buildvariants:

# Amazon

- name: amazon-v2
  display_name: Amazon v2 x86_64
  run_on:
    - amazon2-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

# Debian

- name: debian81
  display_name: Debian 8.1 x86_64
  run_on:
    - debian81-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: debian92
  display_name: Debian 9.2 x86_64
  run_on:
    - debian92-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

# RedHat

- name: rhel62
  display_name: RedHat 6.2 x86_64
  run_on:
    - rhel62-large
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: rhel70
  display_name: RedHat 7.0 x86_64
  run_on:
    - rhel70
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

# SUSE

- name: suse12
  display_name: SUSE 12 x86_64
  run_on:
    - suse12-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

# Ubuntu

- name: ubuntu1404
  display_name: Ubuntu 14.04 x86_64
  run_on:
    - ubuntu1404-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: ubuntu1604
  display_name: Ubuntu 16.04 x86_64
  run_on:
    - ubuntu1604-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: ubuntu1804
  display_name: Ubuntu 18.04 x86_64
  run_on:
    - ubuntu1804-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

# Windows

- name: windows64
  display_name: Windows64
  run_on:
    - windows-64-vs2015-test
  tasks:
    - build-win-perls
    - validate-win-perls
    - push-win-perls

# ZAP

- name: rhel67-zseries
  display_name: ZAP RedHat 6.7 Z Series
  run_on:
    - rhel67-zseries-test
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: ubuntu1604-arm64
  display_name: ZAP Ubuntu 16.04 ARM64
  run_on:
    - ubuntu1604-arm64-large
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: rhel71-power8
  display_name: ZAP RedHat 7.1 Power8
  run_on:
    - rhel71-power8-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

- name: ubuntu1604-power8
  display_name: ZAP Ubuntu 16.04 Power8
  run_on:
    - ubuntu1604-power8-build
  tasks:
    - build-unix-perls
    - validate-unix-perls
    - push-unix-perls

{'fraction_non_alphanumeric': 0.11416666666666667, 'fraction_numerical': 0.027045454545454546, 'mean_word_length': 2.2675742574257427, 'pattern_counts': {'":': 14, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2206365', 'n_tokens_mistral': 5234, 'n_tokens_neox': 4922, 'n_words': 903}