resource_types:
  - name: pull_request
    type: docker-image
    source:
      repository: jtarchie/pr

resources:
  - name: orca_pr
    type: pull_request
    source:
      repo: greenplum-db/gporca
      access_token: {{gporcabot_access_token}}
      ignore_paths:
      - README.md
      - LICENSE
      - COPYRIGHT
      - .gitignore

  - name: xerces_patch
    type: git
    source:
      branch: master
      paths:
      - patches/xerces-c-gpdb.patch
      - concourse/xerces-c
      - concourse/package_tarball.bash
      uri: https://github.com/greenplum-db/gporca
  
  - name: bin_xerces_centos5
    type: s3
    source:
      access_key_id: {{s3_access_key_id}}
      bucket: {{bucket-name}}
      region_name: {{aws-region}}
      secret_access_key: {{s3_secret_access_key}}
      versioned_file: bin_xerces_centos5.tar.gz

jobs:
- name: xerces_centos5
  public: true
  max_in_flight: 2
  plan:
  - get: xerces_patch
    trigger: true
  - aggregate:
    - task: build
      file: xerces_patch/concourse/xerces-c/build_xerces_centos5.yml
  - aggregate:
    - task: package_tarball
      file: xerces_patch/concourse/xerces-c/package_tarball_centos5.yml
  - aggregate:
    - put: bin_xerces_centos5
      params:
        from: package_tarball_centos5/bin_xerces_centos5.tar.gz

- name: compile_and_test_gporca
  public: true
  max_in_flight: 2
  plan:
  - get: orca_src
    resource: orca_pr
    trigger: true
    version: every
  - get: bin_xerces_centos5
    passed:
    - xerces_centos5
  - put: orca_pr
    params:
      path: orca_src
      status: pending
  - task: build_and_test_release
    file: orca_src/concourse/build_and_test_centos5_release.yml
    on_failure: &pr_failure
      put: orca_pr
      params:
        path: orca_src
        status: failure
    timeout: 30m
  - put: report_pr_success
    resource: orca_pr
    params:
      path: orca_src
      status: success

Add GPORCA PR pipeline to run ctests
Add GPORCA PR pipeline to run ctests

The PR pipeline runs ctests in release build.

[ci skip]

Signed-off-by: Haisheng Yuan <d24d5fc9e8498fe12c79f514db1a69a6d06b8a3c@pivotal.io>
