Skip to content

Commit

Permalink
Sync tools folder from main branch to generation branch
Browse files Browse the repository at this point in the history
  • Loading branch information
azurepowershell committed Jan 4, 2024
1 parent ddb9343 commit 90d05b0
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 38 deletions.
58 changes: 26 additions & 32 deletions .azure-pipelines/code-gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,36 +75,30 @@ jobs:
}
git checkout src/${{ parameters.ServiceName }};
git checkout -b codegen/${{ parameters.ServiceName }} origin/${{ parameters.TargetBranch }};
- task: PowerShell@2.232.1
- 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;
displayName: Create codegen/${{ parameters.ServiceName }} branch
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
- 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
displayName: Create PR to main branch
12 changes: 9 additions & 3 deletions .azure-pipelines/code-oob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ stages:
``````
- Install the latest Az.Accounts module unless the OOB build requires a specific version.
``````powershell
Install-Module Az.Accounts -Repository PSGallery
Install-Module Az.Accounts -Repository PSGallery
``````
- Use Az.Tools.Installer to install the OOB build.
``````powershell
Expand Down Expand Up @@ -118,7 +118,6 @@ stages:
displayName: Create PR to main branch
condition: and(succeeded(), eq(variables['NeedBumpUp'], 'true'))


- task: PowerShell@2
displayName: publish oob tools
inputs:
Expand All @@ -127,6 +126,13 @@ stages:
Copy-Item .\tools\ModulePublisher.psd1 -Destination OOB
Copy-Item .\tools\ModulePublisher.psm1 -Destination OOB
Copy-Item .\tools\NuGet.exe -Destination OOB
- task: ManifestGeneratorTask@0
displayName: 'Generation Task'
inputs:
PackageName: 'Azure PowerShell - ${{ parameters.ServiceName }}'
BuildDropPath: '$(System.ArtifactsDirectory)/OOB'

- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: OOB
Expand Down Expand Up @@ -172,4 +178,4 @@ stages:
$moduleName = $jsonObject.ModuleName
$context = New-AzStorageContext -StorageAccountName "$(TestStorageAccountName)"
$package = Get-Item "$(System.ArtifactsDirectory)/artifacts/Az.$moduleName.$versionNumber.nupkg"
$package | Set-AzStorageBlobContent -Container "public" -Context $context -Force
$package | Set-AzStorageBlobContent -Container "public" -Context $context -Force
23 changes: 20 additions & 3 deletions .github/policies/resourceManagement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2861,7 +2861,9 @@ configuration:
then:
- mentionUsers:
mentionees:
- fwsuppgithub
- gopimsft
- gimotwanMSFT
- avripintoms
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
assignMentionees: False
- if:
Expand Down Expand Up @@ -3028,6 +3030,22 @@ configuration:
- vpngwsuppgithub
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
assignMentionees: False
- if:
- or:
- labelAdded:
label: Service Attention
- labelAdded:
label: Nginx
- hasLabel:
label: Service Attention
- hasLabel:
label: Nginx
then:
- mentionUsers:
mentionees:
- limingu
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
assignMentionees: False
- if:
- or:
- labelAdded:
Expand Down Expand Up @@ -3175,8 +3193,7 @@ configuration:
then:
- mentionUsers:
mentionees:
- pvrk
- adityabalaji-msft
- Daya-Patil
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
assignMentionees: False
- if:
Expand Down

0 comments on commit 90d05b0

Please sign in to comment.