jobs:
- job: Linux
  pool:
    vmImage: ubuntu-16.04
  steps:
    - bash: |
        set -ex
        if [[ -n "$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" ]]; then
          git fetch origin "master:master" "pull/$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER/head:pr"
          git checkout pr
        fi
        set -u
        sudo mkdir /home/linuxbrew
        sudo chown "$USER" /home/linuxbrew
        git config --global user.name LinuxbrewTestBot
        git config --global user.email testbot@linuxbrew.sh
        git clone https://github.com/Linuxbrew/brew /home/linuxbrew/.linuxbrew/Homebrew
        mkdir /home/linuxbrew/.linuxbrew/bin
        ln -s ../Homebrew/bin/brew /home/linuxbrew/.linuxbrew/bin/
        mkdir -p /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew
        ln -s "$PWD" /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-extra
        /home/linuxbrew/.linuxbrew/bin/brew install patchelf
        /home/linuxbrew/.linuxbrew/bin/brew test-bot --bintray-org=linuxbrew --git-name=LinuxbrewTestBot --git-email=testbot@linuxbrew.sh
      displayName: Run brew test-bot
      env:
        HOMEBREW_GITHUB_API_TOKEN: $(github.publicApiToken)
        HOMEBREW_NO_ANALYTICS: 1
        HOMEBREW_NO_AUTO_UPDATE: 1

jobs:
- job: Linux
  pool:
    vmImage: ubuntu-16.04
  steps:
    - bash: |
        set -ex
        if [[ -n "$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" ]]; then
          git fetch origin "master:master" "pull/$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER/head:pr"
          git checkout pr
        fi
        set -u
        sudo mkdir /home/linuxbrew
        sudo chown "$USER" /home/linuxbrew
        git config --global user.name LinuxbrewTestBot
        git config --global user.email testbot@linuxbrew.sh
        git clone https://github.com/Homebrew/brew /home/linuxbrew/.linuxbrew/Homebrew
        mkdir /home/linuxbrew/.linuxbrew/bin
        ln -s ../Homebrew/bin/brew /home/linuxbrew/.linuxbrew/bin/
        mkdir -p /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew
        ln -s "$PWD" /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-extra
        /home/linuxbrew/.linuxbrew/bin/brew install patchelf
        /home/linuxbrew/.linuxbrew/bin/brew test-bot --bintray-org=linuxbrew --git-name=LinuxbrewTestBot --git-email=testbot@linuxbrew.sh
      displayName: Run brew test-bot
      env:
        HOMEBREW_GITHUB_API_TOKEN: $(github.publicApiToken)
        HOMEBREW_NO_ANALYTICS: 1
        HOMEBREW_NO_AUTO_UPDATE: 1

Clone Homebrew/brew not Linuxbrew/brew on Azure
Clone Homebrew/brew not Linuxbrew/brew on Azure
