Skip to content

Commit 44d47b3

Browse files
azure-powershell-botazurepowershell
and
azurepowershell
authored
Sync tools folder from main branch to generation branch (#23824)
Co-authored-by: azurepowershell <[email protected]>
1 parent a579656 commit 44d47b3

File tree

1 file changed

+31
-25
lines changed

1 file changed

+31
-25
lines changed

.azure-pipelines/code-gen.yml

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -75,30 +75,36 @@ jobs:
7575
}
7676
git checkout src/${{ parameters.ServiceName }};
7777
git checkout -b codegen/${{ parameters.ServiceName }} origin/${{ parameters.TargetBranch }};
78-
- pwsh: |
79-
#Uninstall-Module -Name PackageManagement -AllVersions
80-
Install-Module -Name PowerShellGet -RequiredVersion 2.2.3 -Force;
81-
Install-Module -Name platyPS -RequiredVersion 0.14.2 -Force;
82-
Install-Module -Name Az.Accounts -Force;
83-
Import-Module .\tools\Gen2Master\MoveFromGeneration2Master.ps1;
84-
Move-Generation2Master -SourcePath .\artifacts\src\${{ parameters.ServiceName }} -DestPath .\src\${{ parameters.ServiceName }};
85-
git config user.email "[email protected]";
86-
git config user.name "azure-powershell-bot";
87-
git add ./src;
88-
git add tools/CreateMappings_rules.json;
89-
git commit -m "Move ${{ parameters.ServiceName }} to ${{ parameters.TargetBranch }}";
90-
git remote set-url origin https://azure-powershell-bot:$(GithubToken)@github.com/Azure/azure-powershell.git;
91-
git push origin codegen/${{ parameters.ServiceName }} --force;
78+
9279
displayName: Create codegen/${{ parameters.ServiceName }} branch
93-
- pwsh: |
94-
$SourceBranch = "$(Build.SourceBranch)"
95-
$SourceBranch = $SourceBranch.Replace("refs/heads/", "")
96-
$Title = "Migrate ${{ parameters.ServiceName }} from $SourceBranch to ${{ parameters.TargetBranch }}"
97-
$HeadBranch = "codegen/${{ parameters.ServiceName }}"
98-
$BaseBranch = "${{ parameters.TargetBranch }}"
99-
$Description = "Migrate ${{ parameters.ServiceName }} from $SourceBranch to ${{ parameters.TargetBranch }}
100-
The last commit of src/${{ parameters.ServiceName }} in $SourceBranch is:
101-
$(git log -1 origin/$SourceBranch -- ./src/${{ parameters.ServiceName }})
102-
"
103-
./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $(GithubToken) -Description $Description
80+
inputs:
81+
targetType: inline
82+
script: >-
83+
#Uninstall-Module -Name PackageManagement -AllVersions
84+
Install-Module -Name PowerShellGet -RequiredVersion 2.2.3 -Force;
85+
Install-Module -Name platyPS -RequiredVersion 0.14.2 -Force;
86+
Install-Module -Name Az.Accounts -Force;
87+
Import-Module .\tools\Gen2Master\MoveFromGeneration2Master.ps1;
88+
Move-Generation2Master -SourcePath .\artifacts\src\${{ parameters.ServiceName }} -DestPath .\src\${{ parameters.ServiceName }};
89+
git config user.email "[email protected]";
90+
git config user.name "azure-powershell-bot";
91+
git add ./src;
92+
git add tools/CreateMappings_rules.json;
93+
git commit -m "Move ${{ parameters.ServiceName }} to ${{ parameters.TargetBranch }}";
94+
git remote set-url origin https://azure-powershell-bot:$(GithubToken)@github.com/Azure/azure-powershell.git;
95+
git push origin codegen/${{ parameters.ServiceName }} --force;
96+
- task: PowerShell@2
10497
displayName: Create PR to main branch
98+
inputs:
99+
targetType: inline
100+
script: >-
101+
$SourceBranch = "$(Build.SourceBranch)"
102+
$SourceBranch = $SourceBranch.Replace("refs/heads/", "")
103+
$Title = "Migrate ${{ parameters.ServiceName }} from $SourceBranch to ${{ parameters.TargetBranch }}"
104+
$HeadBranch = "codegen/${{ parameters.ServiceName }}"
105+
$BaseBranch = "${{ parameters.TargetBranch }}"
106+
$Description = "Migrate ${{ parameters.ServiceName }} from $SourceBranch to ${{ parameters.TargetBranch }}
107+
The last commit of src/${{ parameters.ServiceName }} in $SourceBranch is:
108+
$(git log -1 origin/$SourceBranch -- ./src/${{ parameters.ServiceName }})
109+
"
110+
./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $(GithubToken) -Description $Description

0 commit comments

Comments
 (0)