<commit_before>resources:
- name: bosh-agent-windows
  type: git
  source:
    branch: windows
    uri: https://github.com/cloudfoundry/bosh-agent.git
- name: bosh-agent-zip-version
  type: semver
  source:
    bucket: windows-bosh-integration
    key: versions/bosh-agent-version
    access_key_id: {{AWS_ACCESS_KEY}}
    secret_access_key: {{AWS_SECRET_KEY}}
- name: bosh-agent-zip
  type: s3
  source:
    bucket: windows-bosh-integration
    regexp: bosh-agent-windows-v(.*).zip
    access_key_id: {{AWS_ACCESS_KEY}}
    secret_access_key: {{AWS_SECRET_KEY}}
- name: bosh-agent-deps-zip
  type: s3
  source:
    bucket: bosh-windows-dependencies
    regexp: agent-dependencies-v(.*).zip
    access_key_id: {{AWS_ACCESS_KEY}}
    secret_access_key: {{AWS_SECRET_KEY}}
- name: bosh-vsphere-stemcell-version
  type: semver
  source:
    bucket: bosh-windows-stemcells
    key: versions/bosh-vsphere-stemcell-version
    access_key_id: {{AWS_ACCESS_KEY}}
    secret_access_key: {{AWS_SECRET_KEY}}
- name: bosh-vsphere-stemcell
  type: s3
  source:
    bucket: bosh-windows-stemcells
    regexp: bosh-stemcell-(.*)-vsphere-esxi-windows2012R2-go_agent.tgz
    access_key_id: {{AWS_ACCESS_KEY}}
    secret_access_key: {{AWS_SECRET_KEY}}
- name: ovftool-linux
  type: s3
  source:
    bucket: bosh-windows-stemcells
    regexp: VMware-ovftool-(.*)-lin.x86_64.bundle
    access_key_id: {{AWS_ACCESS_KEY}}
    secret_access_key: {{AWS_SECRET_KEY}}
- name: vsphere-deployment
  type: bosh-deployment
  source:
    target: {{DIRECTOR_IP}}
    username: {{BOSH_USER}}
    password: {{<PASSWORD>}}
    deployment: sample-errand-windows-deployment

jobs:
- name: test-compile-and-push
  serial: true
  plan:
  - get: bosh-agent
    trigger: true
    resource: bosh-agent-windows
  - aggregate:
    - task: test-unit
      file: bosh-agent/ci/tasks/test-unit-windows.yml
    - put: bosh-agent-zip-version
      params:
        bump: patch
    - task: compile-agent
      privileged: true
      file: bosh-agent/ci/tasks/compile-agent-windows.yml
  - put: bosh-agent-zip
    params:
      file: compiled-agent-zip/bosh-windows-integration-v*.zip

- name: test-integration
  serial: true
  plan:
  - get: bosh-agent
    resource: bosh-agent-windows
  - get: bosh-agent-deps-zip
  - get: bosh-agent-zip
    passed:
    - test-compile-and-push
    trigger: true
  - task: test-integration
    privileged: true
    file: bosh-agent/ci/tasks/test-integration-windows.yml
    config:
      params:
        AWS_ACCESS_KEY: {{AWS_ACCESS_KEY}}
        AWS_SECRET_KEY: {{AWS_SECRET_KEY}}
        AWS_SUBNET: subnet-110fae67
        AWS_SSH_KEY: {{AWS_SSH_KEY}}
        KEYPAIR_NAME: agent-integration
        NATS_ELASTIC_IP: 192.168.3.11
        VAGRANT_PROVIDER: aws
        WINRM_PASSWORD: {{WIN<PASSWORD>}}

- name: create-vsphere-stemcell-and-push
  serial: true
  plan:
  - get: bosh-agent
    tags: [vsphere-windows]
    resource: bosh-agent-windows
  - get: bosh-agent-deps-zip
    tags: [vsphere-windows]
    passed:
    - test-integration
  - get: bosh-agent-zip
    tags: [vsphere-windows]
    passed:
    - test-integration
  - get: ovftool-linux
    tags: [vsphere-windows]
  - put: bosh-vsphere-stemcell-version
    tags: [vsphere-windows]
    params:
      bump: patch
  - task: create-vsphere-stemcell
    privileged: true
    file: bosh-agent/ci/tasks/create-vsphere-stemcell-windows.yml
    tags: [vsphere-windows]
    config:
      params: &vagrant-vsphere-params
        VCENTER_HOST: {{VCENTER_HOST}}
        VCENTER_COMPUTE_RESOURCE: {{VCENTER_COMPUTE_RESOURCE}}
        VCENTER_DATACENTER: {{VCENTER_DATACENTER}}
        VCENTER_RESOURCE_POOL: {{VCENTER_RESOURCE_POOL}}
        VCENTER_TEMPLATE_NAME: {{VCENTER_TEMPLATE_NAME}}
        VCENTER_PASSWORD: {{<PASSWORD>}}
        VCENTER_USERNAME: {{VCENTER_USERNAME}}
        VCENTER_FINGERPRINT: {{VCENTER_FINGERPRINT}}
        VCENTER_VM_BASE_PATH: {{VCENTER_VM_BASE_PATH}}
        VCENTER_VM_NAME: {{VCENTER_VM_NAME}}
        WINRM_PASSWORD: {{<PASSWORD>}}
        WINRM_USERNAME: {{WINRM_USERNAME}}
        VAGRANT_HOME: ./vagrant_home/.vagrant.d/
        VAGRANT_DOTFILE_PATH: ./vagrant_home/.vagrant/
        VAGRANT_VAGRANTFILE: ./gopath/src/github.com/cloudfoundry/bosh-agent/ci/Vagrantfile-vsphere-windows
    ensure:
      task: vagrant-destroy-vsphere
      tags: [vsphere-windows]
      config:
        platform: linux
        image: docker:///bosh/init
        params: *vagrant-vsphere-params
        run:
          path: sh
          args:
          - -c
          - vagrant destroy --force
        inputs:
        - name: bosh-agent
          path: gopath/src/github.com/cloudfoundry/bosh-agent
        - name: vagrant_home
  - put: bosh-vsphere-stemcell
    params:
      from: /bosh-vsphere-stemcell/bosh-stemcell-(.*)-vsphere-esxi-windows2012R2-go_agent.tgz
      to: /
- name: test-vsphere-stemcell
  serial: true
  plan:
  - get: bosh-agent
    tags: [vsphere-windows]
    resource: bosh-agent-windows
  - get: bosh-vsphere-stemcell
    tags: [vsphere-windows]
    trigger: true
    passed:
    - create-vsphere-stemcell-and-push
  - task: create-vsphere-errand-release
    file: bosh-agent/ci/tasks/create-vsphere-errand-release-windows.yml
    tags: [vsphere-windows]
    outputs:
      - name: vsphere-errand-release
    config:
      params:
        DIRECTOR_UUID: {{DIRECTOR_UUID}}
        DEPLOYMENT_NAME: sample-errand-windows-deployment
        RELEASE_NAME: sample-vsphere-release
        JOB_NAME: sample-errand
        BOSH_USER: {{BOSH_USER}}
        BOSH_PASSWORD: {{<PASSWORD>}}
        BOSH_RANGE: {{BOSH_RANGE}}
        BOSH_GATEWAY: {{BOSH_GATEWAY}}
        BOSH_DNS: {{BOSH_DNS}}
        BOSH_RESERVED: {{BOSH_RESERVED}}
        BOSH_STATIC: {{BOSH_STATIC}}
        BOSH_NETWORK_NAME: {{BOSH_NETWORK_NAME}}

  - put: vsphere-deployment
    tags: [vsphere-windows]
    inputs:
      - name: vsphere-errand-release
    params:
      manifest: vsphere-errand-release/manifest.yml
      stemcells:
      - bosh-vsphere-stemcell/*.tgz
      releases:
      - vsphere-errand-release/sample-vsphere-release/dev_releases/sample-vsphere-release/sample-vsphere-release-*.tgz
      cleanup: true
  - task: bosh-run-vsphere-errand
    tags: [vsphere-windows]
    config:
      platform: linux
      image: docker:///bosh/windows
      inputs:
      - name: vsphere-errand-release
      run:
        path: sh
        args:
        - -c
        - 'bosh -n --color -t $DIRECTOR_IP -d vsphere-errand-release/manifest.yml run errand $JOB_NAME'
      params:
        DIRECTOR_IP: {{DIRECTOR_IP}}
        BOSH_USER: {{BOSH_USER}}
        BOSH_PASSWORD: {{<PASSWORD>}}
        JOB_NAME: sample-errand
    ensure:
      task: bosh-cleanup-vsphere
      tags: [vsphere-windows]
      config:
        platform: linux
        image: docker:///bosh/windows
        run:
          path: sh
          args:
          - -c
          - '
            bosh -n --color -t $DIRECTOR_IP delete deployment sample-vsphere-deployment
            &&
            bosh -n --color -t $DIRECTOR_IP cleanup --all
            '
        params:
          DIRECTOR_IP: {{DIRECTOR_IP}}
          BOSH_USER: {{BOSH_USER}}
          BOSH_PASSWORD: {{<PASSWORD>}}
<commit_msg>Run the unit-tests serially with the compile agent task<commit_after>resources:
- name: bosh-agent-windows
  type: git
  source:
    branch: windows
    uri: https://github.com/cloudfoundry/bosh-agent.git
- name: bosh-agent-zip-version
  type: semver
  source:
    bucket: windows-bosh-integration
    key: versions/bosh-agent-version
    access_key_id: {{AWS_ACCESS_KEY}}
    secret_access_key: {{AWS_SECRET_KEY}}
- name: bosh-agent-zip
  type: s3
  source:
    bucket: windows-bosh-integration
    regexp: bosh-agent-windows-v(.*).zip
    access_key_id: {{AWS_ACCESS_KEY}}
    secret_access_key: {{AWS_SECRET_KEY}}
- name: bosh-agent-deps-zip
  type: s3
  source:
    bucket: bosh-windows-dependencies
    regexp: agent-dependencies-v(.*).zip
    access_key_id: {{AWS_ACCESS_KEY}}
    secret_access_key: {{AWS_SECRET_KEY}}
- name: bosh-vsphere-stemcell-version
  type: semver
  source:
    bucket: bosh-windows-stemcells
    key: versions/bosh-vsphere-stemcell-version
    access_key_id: {{AWS_ACCESS_KEY}}
    secret_access_key: {{AWS_SECRET_KEY}}
- name: bosh-vsphere-stemcell
  type: s3
  source:
    bucket: bosh-windows-stemcells
    regexp: bosh-stemcell-(.*)-vsphere-esxi-windows2012R2-go_agent.tgz
    access_key_id: {{AWS_ACCESS_KEY}}
    secret_access_key: {{AWS_SECRET_KEY}}
- name: ovftool-linux
  type: s3
  source:
    bucket: bosh-windows-stemcells
    regexp: VMware-ovftool-(.*)-lin.x86_64.bundle
    access_key_id: {{AWS_ACCESS_KEY}}
    secret_access_key: {{AWS_SECRET_KEY}}
- name: vsphere-deployment
  type: bosh-deployment
  source:
    target: {{DIRECTOR_IP}}
    username: {{BOSH_USER}}
    password: {{<PASSWORD>}}
    deployment: sample-errand-windows-deployment

jobs:
- name: test-compile-and-push
  serial: true
  plan:
  - get: bosh-agent
    trigger: true
    resource: bosh-agent-windows
  - put: bosh-agent-zip-version
    params:
      bump: patch
  - task: test-unit
    file: bosh-agent/ci/tasks/test-unit-windows.yml
  - task: compile-agent
    privileged: true
    file: bosh-agent/ci/tasks/compile-agent-windows.yml
  - put: bosh-agent-zip
    params:
      file: compiled-agent-zip/bosh-windows-integration-v*.zip

- name: test-integration
  serial: true
  plan:
  - get: bosh-agent
    resource: bosh-agent-windows
  - get: bosh-agent-deps-zip
  - get: bosh-agent-zip
    passed:
    - test-compile-and-push
    trigger: true
  - task: test-integration
    privileged: true
    file: bosh-agent/ci/tasks/test-integration-windows.yml
    config:
      params:
        AWS_ACCESS_KEY: {{AWS_ACCESS_KEY}}
        AWS_SECRET_KEY: {{AWS_SECRET_KEY}}
        AWS_SUBNET: subnet-110fae67
        AWS_SSH_KEY: {{AWS_SSH_KEY}}
        KEYPAIR_NAME: agent-integration
        NATS_ELASTIC_IP: 192.168.3.11
        VAGRANT_PROVIDER: aws
        WINRM_PASSWORD: {{<PASSWORD>}}

- name: create-vsphere-stemcell-and-push
  serial: true
  plan:
  - get: bosh-agent
    tags: [vsphere-windows]
    resource: bosh-agent-windows
  - get: bosh-agent-deps-zip
    tags: [vsphere-windows]
    passed:
    - test-integration
  - get: bosh-agent-zip
    tags: [vsphere-windows]
    passed:
    - test-integration
  - get: ovftool-linux
    tags: [vsphere-windows]
  - put: bosh-vsphere-stemcell-version
    tags: [vsphere-windows]
    params:
      bump: patch
  - task: create-vsphere-stemcell
    privileged: true
    file: bosh-agent/ci/tasks/create-vsphere-stemcell-windows.yml
    tags: [vsphere-windows]
    config:
      params: &vagrant-vsphere-params
        VCENTER_HOST: {{VCENTER_HOST}}
        VCENTER_COMPUTE_RESOURCE: {{VCENTER_COMPUTE_RESOURCE}}
        VCENTER_DATACENTER: {{VCENTER_DATACENTER}}
        VCENTER_RESOURCE_POOL: {{VCENTER_RESOURCE_POOL}}
        VCENTER_TEMPLATE_NAME: {{VCENTER_TEMPLATE_NAME}}
        VCENTER_PASSWORD: {{<PASSWORD>_PASSWORD}}
        VCENTER_USERNAME: {{VCENTER_USERNAME}}
        VCENTER_FINGERPRINT: {{VCENTER_FINGERPRINT}}
        VCENTER_VM_BASE_PATH: {{VCENTER_VM_BASE_PATH}}
        VCENTER_VM_NAME: {{VCENTER_VM_NAME}}
        WINRM_PASSWORD: {{<PASSWORD>}}
        WINRM_USERNAME: {{WINRM_USERNAME}}
        VAGRANT_HOME: ./vagrant_home/.vagrant.d/
        VAGRANT_DOTFILE_PATH: ./vagrant_home/.vagrant/
        VAGRANT_VAGRANTFILE: ./gopath/src/github.com/cloudfoundry/bosh-agent/ci/Vagrantfile-vsphere-windows
    ensure:
      task: vagrant-destroy-vsphere
      tags: [vsphere-windows]
      config:
        platform: linux
        image: docker:///bosh/init
        params: *vagrant-vsphere-params
        run:
          path: sh
          args:
          - -c
          - vagrant destroy --force
        inputs:
        - name: bosh-agent
          path: gopath/src/github.com/cloudfoundry/bosh-agent
        - name: vagrant_home
  - put: bosh-vsphere-stemcell
    params:
      from: /bosh-vsphere-stemcell/bosh-stemcell-(.*)-vsphere-esxi-windows2012R2-go_agent.tgz
      to: /
- name: test-vsphere-stemcell
  serial: true
  plan:
  - get: bosh-agent
    tags: [vsphere-windows]
    resource: bosh-agent-windows
  - get: bosh-vsphere-stemcell
    tags: [vsphere-windows]
    trigger: true
    passed:
    - create-vsphere-stemcell-and-push
  - task: create-vsphere-errand-release
    file: bosh-agent/ci/tasks/create-vsphere-errand-release-windows.yml
    tags: [vsphere-windows]
    outputs:
      - name: vsphere-errand-release
    config:
      params:
        DIRECTOR_UUID: {{DIRECTOR_UUID}}
        DEPLOYMENT_NAME: sample-errand-windows-deployment
        RELEASE_NAME: sample-vsphere-release
        JOB_NAME: sample-errand
        BOSH_USER: {{BOSH_USER}}
        BOSH_PASSWORD: {{BOSH_PASSWORD}}
        BOSH_RANGE: {{BOSH_RANGE}}
        BOSH_GATEWAY: {{BOSH_GATEWAY}}
        BOSH_DNS: {{BOSH_DNS}}
        BOSH_RESERVED: {{BOSH_RESERVED}}
        BOSH_STATIC: {{BOSH_STATIC}}
        BOSH_NETWORK_NAME: {{BOSH_NETWORK_NAME}}

  - put: vsphere-deployment
    tags: [vsphere-windows]
    inputs:
      - name: vsphere-errand-release
    params:
      manifest: vsphere-errand-release/manifest.yml
      stemcells:
      - bosh-vsphere-stemcell/*.tgz
      releases:
      - vsphere-errand-release/sample-vsphere-release/dev_releases/sample-vsphere-release/sample-vsphere-release-*.tgz
      cleanup: true
  - task: bosh-run-vsphere-errand
    tags: [vsphere-windows]
    config:
      platform: linux
      image: docker:///bosh/windows
      inputs:
      - name: vsphere-errand-release
      run:
        path: sh
        args:
        - -c
        - 'bosh -n --color -t $DIRECTOR_IP -d vsphere-errand-release/manifest.yml run errand $JOB_NAME'
      params:
        DIRECTOR_IP: {{DIRECTOR_IP}}
        BOSH_USER: {{BOSH_USER}}
        BOSH_PASSWORD: {{BO<PASSWORD>}}
        JOB_NAME: sample-errand
    ensure:
      task: bosh-cleanup-vsphere
      tags: [vsphere-windows]
      config:
        platform: linux
        image: docker:///bosh/windows
        run:
          path: sh
          args:
          - -c
          - '
            bosh -n --color -t $DIRECTOR_IP delete deployment sample-vsphere-deployment
            &&
            bosh -n --color -t $DIRECTOR_IP cleanup --all
            '
        params:
          DIRECTOR_IP: {{DIRECTOR_IP}}
          BOSH_USER: {{BOSH_USER}}
          BOSH_PASSWORD: {{<PASSWORD>}}

{'fraction_non_alphanumeric': 0.1180420936028801, 'fraction_numerical': 0.004430905566325118, 'mean_word_length': 2.5447852760736196, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6475462', 'n_tokens_mistral': 5378, 'n_tokens_neox': 5229, 'n_words': 859}