Skip to content

Commit

Permalink
Ping the PowerShell task version in code-gen to 2.232.1 (Azure#23816)
Browse files Browse the repository at this point in the history
  • Loading branch information
wyunchi-ms authored Dec 26, 2023
1 parent b1e84ce commit 4deb9e9
Showing 1 changed file with 31 additions and 25 deletions.
56 changes: 31 additions & 25 deletions .azure-pipelines/code-gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,30 +75,36 @@ jobs:
}
git checkout src/${{ parameters.ServiceName }};
git checkout -b codegen/${{ parameters.ServiceName }} origin/${{ parameters.TargetBranch }};
- pwsh: |
#Uninstall-Module -Name PackageManagement -AllVersions
Install-Module -Name PowerShellGet -RequiredVersion 2.2.3 -Force;
Install-Module -Name platyPS -RequiredVersion 0.14.2 -Force;
Install-Module -Name Az.Accounts -Force;
Import-Module .\tools\Gen2Master\MoveFromGeneration2Master.ps1;
Move-Generation2Master -SourcePath .\artifacts\src\${{ parameters.ServiceName }} -DestPath .\src\${{ parameters.ServiceName }};
git config user.email "65331932+azure-powershell-bot@users.noreply.github.com";
git config user.name "azure-powershell-bot";
git add ./src;
git add tools/CreateMappings_rules.json;
git commit -m "Move ${{ parameters.ServiceName }} to ${{ parameters.TargetBranch }}";
git remote set-url origin https://azure-powershell-bot:$(GithubToken)@github.com/Azure/azure-powershell.git;
git push origin codegen/${{ parameters.ServiceName }} --force;
- task: PowerShell@2.232.1
displayName: Create codegen/${{ parameters.ServiceName }} branch
- pwsh: |
$SourceBranch = "$(Build.SourceBranch)"
$SourceBranch = $SourceBranch.Replace("refs/heads/", "")
$Title = "Migrate ${{ parameters.ServiceName }} from $SourceBranch to ${{ parameters.TargetBranch }}"
$HeadBranch = "codegen/${{ parameters.ServiceName }}"
$BaseBranch = "${{ parameters.TargetBranch }}"
$Description = "Migrate ${{ parameters.ServiceName }} from $SourceBranch to ${{ parameters.TargetBranch }}
The last commit of src/${{ parameters.ServiceName }} in $SourceBranch is:
$(git log -1 origin/$SourceBranch -- ./src/${{ parameters.ServiceName }})
"
./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $(GithubToken) -Description $Description
inputs:
targetType: inline
script: >-
#Uninstall-Module -Name PackageManagement -AllVersions
Install-Module -Name PowerShellGet -RequiredVersion 2.2.3 -Force;
Install-Module -Name platyPS -RequiredVersion 0.14.2 -Force;
Install-Module -Name Az.Accounts -Force;
Import-Module .\tools\Gen2Master\MoveFromGeneration2Master.ps1;
Move-Generation2Master -SourcePath .\artifacts\src\${{ parameters.ServiceName }} -DestPath .\src\${{ parameters.ServiceName }};
git config user.email "65331932+azure-powershell-bot@users.noreply.github.com";
git config user.name "azure-powershell-bot";
git add ./src;
git add tools/CreateMappings_rules.json;
git commit -m "Move ${{ parameters.ServiceName }} to ${{ parameters.TargetBranch }}";
git remote set-url origin https://azure-powershell-bot:$(GithubToken)@github.com/Azure/azure-powershell.git;
git push origin codegen/${{ parameters.ServiceName }} --force;
- task: PowerShell@2
displayName: Create PR to main branch
inputs:
targetType: inline
script: >-
$SourceBranch = "$(Build.SourceBranch)"
$SourceBranch = $SourceBranch.Replace("refs/heads/", "")
$Title = "Migrate ${{ parameters.ServiceName }} from $SourceBranch to ${{ parameters.TargetBranch }}"
$HeadBranch = "codegen/${{ parameters.ServiceName }}"
$BaseBranch = "${{ parameters.TargetBranch }}"
$Description = "Migrate ${{ parameters.ServiceName }} from $SourceBranch to ${{ parameters.TargetBranch }}
The last commit of src/${{ parameters.ServiceName }} in $SourceBranch is:
$(git log -1 origin/$SourceBranch -- ./src/${{ parameters.ServiceName }})
"
./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $(GithubToken) -Description $Description

0 comments on commit 4deb9e9

Please sign in to comment.