-
Notifications
You must be signed in to change notification settings - Fork 6
96 lines (82 loc) · 3.99 KB
/
ado-migration-process-full.yml
File metadata and controls
96 lines (82 loc) · 3.99 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Full ADO Project Migration
run-name: "${{ github.event.inputs.SourceOrganizationName }}/${{ github.event.inputs.SourceProjectName }}=>${{ github.event.inputs.TargetOrganizationName }}/${{ github.event.inputs.TargetProjectName }} [Full Migration]"
on:
workflow_dispatch:
inputs:
SourceOrganizationName:
description: "Name of the Source Organization"
required: true
default: "AIZ-GL"
SourceProjectName:
description: "Name of the Source Project"
required: true
default: "GL.CL-Elita"
TargetOrganizationName:
description: "Name of the Target Organization"
required: true
default: "AIZ-Global"
TargetProjectName:
description: "Name of the Target Project"
required: true
default: "GL.CL-Elita-migrated"
WhatIf:
type: boolean
description: "WhatIf: Simulated Run"
required: false
default: true
jobs:
run-powershell-script:
name: Run PowerShell Script
runs-on: 'AEC0WGEMP001'
timeout-minutes: 7200
env:
AZURE_DEVOPS_MIGRATION_PAT: ${{ secrets.AZURE_DEVOPS_MIGRATION_PAT }}
steps:
- name: Verify Azure CLI installation
run: |
$env:PATH
if ($env:PATH -notcontains "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin") {
$env:PATH += ";C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin"
}
az --version
- name: Checkout repository
uses: actions/checkout@v4
- name: Clean Azure DevOps Migration Tools Log Directory
shell: pwsh
run: |
Get-ChildItem "${{ vars.WORKITEMMIGRATORDIRECTORY_V16_0_9 }}/logs" -Recurse | Remove-Item -Recurse
- name: Set Migration Configuration
shell: pwsh
run: |
$SourceOrganizationUrl = "https://dev.azure.com/${{ github.event.inputs.SourceOrganizationName }}/"
$TargetOrganizationUrl = "https://dev.azure.com/${{ github.event.inputs.TargetOrganizationName }}/"
$projectDirectory = "./"
$LocalConfigPath = "configuration\configuration.json"
$filePath = Resolve-Path -Path "$LocalConfigPath"
Write-Host "FILEPATH: $filePath"
$configuration = [Object](Get-Content $LocalConfigPath | Out-String | ConvertFrom-Json)
$configuration.SourceProject.Organization = "$SourceOrganizationUrl"
$configuration.SourceProject.ProjectName = "${{ github.event.inputs.SourceProjectName }}"
$configuration.SourceProject.OrgName = "${{ github.event.inputs.SourceOrganizationName }}"
$configuration.TargetProject.Organization = "$TargetOrganizationUrl"
$configuration.TargetProject.ProjectName = "${{ github.event.inputs.TargetProjectName }}"
$configuration.TargetProject.OrgName = "${{ github.event.inputs.TargetOrganizationName }}"
$configuration.ProjectDirectory = $projectDirectory
$configuration.WorkItemMigratorDirectory = "${{ vars.WORKITEMMIGRATORDIRECTORY_V16_0_9 }}"
$configuration.RepositoryCloneTempDirectory = "${{ vars.RepositoryCloneTempDirectory }}"
$configuration.DevOpsMigrationToolConfigurationFile = "${{ vars.DevOpsMigrationToolConfigurationFile }}"
$configuration.ArtifactFeedPackageVersionLimit = ${{ vars.ArtifactFeedPackageVersionLimit }}
$configuration | ConvertTo-Json -Depth 100 | Set-Content $LocalConfigPath
$configuration2 = [Object](Get-Content $LocalConfigPath | Out-String | ConvertFrom-Json)
Write-Host (ConvertTo-Json -Depth 100 $configuration2)
- name: Run Migrate-Project PowerShell script
shell: pwsh
run: |
$whatIfDryRun = "${{ github.event.inputs.WhatIf }}"
$WhatIf = $whatIfDryRun -match "true"
& ./Step_0_Migrate_Project.ps1 -WhatIf $WhatIf
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: migration-run-logs
path: "./Projects"