forked from Azure/azure-sdk-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
69 lines (65 loc) · 2.26 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
parameters:
- name: Repos
type: object
default:
- RepoOwner: Azure
RepoName: azure-sdk-for-android
- RepoOwner: Azure
RepoName: azure-sdk-for-c
- RepoOwner: Azure
RepoName: azure-sdk-for-cpp
- RepoOwner: Azure
RepoName: azure-sdk-for-go
- RepoOwner: Azure
RepoName: azure-sdk-for-ios
- RepoOwner: Azure
RepoName: azure-sdk-for-java
- RepoOwner: Azure
RepoName: azure-sdk-for-js
- RepoOwner: Azure
RepoName: azure-sdk-for-net
- RepoOwner: Azure
RepoName: azure-sdk-for-python
- name: MigrateFrom
type: string
default: 'not-specified'
- name: MigrateTo
type: string
default: 'not-specified'
trigger: none
pr: none
jobs:
- job: Migration
pool:
name: azsdk-pool-mms-ubuntu-2004-general
variables:
- template: ./templates/variables/globals.yml
steps:
- ${{ each repo in parameters.Repos }}:
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
parameters:
Repositories:
- Name: ${{ repo.RepoOwner }}/${{ repo.RepoName }}
- template: /eng/common/pipelines/templates/steps/set-default-branch.yml
- pwsh: |
$files = git ls-tree $(DefaultBranch) --name-only -r
# Scan all Files
foreach ($file in $files) {
Write-Host $file
$content = Get-Content $file -Raw
$content = $content -replace "${{ parameters.MigrateFrom }}", "${{ parameters.MigrateTo }}"
Set-Content -Path $file.FullName -Value $content
}
displayName: Update pool version from ${{ parameters.MigrateFrom }} to ${{ parameters.MigrateTo }}
- template: /eng/common/pipelines/templates/steps/create-pull-request.yml
parameters:
BaseBranchName: $(DefaultBranch)
PRBranchName: migrate-pool
CommitMsg: "Migrate from ${{ parameters.MigrateFrom }} to ${{ parameters.MigrateTo }}"
RepoOwner: ${{ repo.RepoOwner }}
RepoName: ${{ repo.RepoName }}
OpenAsDraft: true