# Mirror the eng/common folder to all subscribed langauge repos.

trigger:
  branches:
    include:
      - master
  paths:
    include:
      - eng/common

pr: none

resources:
  repositories:
    - repository: azure-sdk-build-tools
      type: git
      name: internal/azure-sdk-build-tools

pool:
  vmImage: ubuntu-18.04

jobs:
  - job: SyncEngCommon
    displayName: Sync eng/common Directory

    steps:
    - template: tools/clone-buildtools/clone-buildtools.yml@azure-sdk-build-tools
    - template: ./templates/steps/sync-directory.yml
      parameters:
        CommitMessage: Sync eng/common directory with azure-sdk-tools repository
        DirectoryToSync: eng/common
        Repos:
          - azure-sdk-for-android
          - azure-sdk-for-c
          - azure-sdk-for-go
          - azure-sdk-for-ios
          - azure-sdk-for-java
          - azure-sdk-for-js
          - azure-sdk-for-net
          - azure-sdk-for-python

# Mirror the eng/common folder to all subscribed langauge repos.

trigger:
  branches:
    include:
      - master
  paths:
    include:
      - eng/common

pr: none

resources:
  repositories:
    - repository: azure-sdk-build-tools
      type: git
      name: internal/azure-sdk-build-tools

pool:
  vmImage: windows-2019

jobs:
  - job: SyncEngCommon
    displayName: Sync eng/common Directory

    steps:
    - template: tools/clone-buildtools/clone-buildtools.yml@azure-sdk-build-tools
    - template: ./templates/steps/sync-directory.yml
      parameters:
        CommitMessage: Sync eng/common directory with azure-sdk-tools repository
        DirectoryToSync: eng/common
        Repos:
          - azure-sdk-for-android
          - azure-sdk-for-c
          - azure-sdk-for-go
          - azure-sdk-for-ios
          - azure-sdk-for-java
          - azure-sdk-for-js
          - azure-sdk-for-net
          - azure-sdk-for-python

Change back to windows host
Change back to windows host

Currently there are some script and pwsh steps that don't
work well on linux so we need to stay on windows until those
can be fixed.

Things that don't work well:

- echo commands in script blocks. On windows they don't need quotes
  but on linux they do and escaping quotes is also different
- commands like mkdir on in pwsh scripts don't work consistently
  on windows it will create parent directories because it does
  the create recurisvely and it is just an alias to new-item. On
  linux it is not an alias and you have to pass the "-p" arg to
  get it to create parent directories. In general we should be careful
  with using alias' for cross-platform pwsh because they are not
  consistently alias' on all platforms.
