-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync tools folder from main branch to generation branch (#19430)
Co-authored-by: azurepowershell <azurepowershell@ms.com>
- Loading branch information
1 parent
91d460d
commit afe0de2
Showing
11 changed files
with
234 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Variable 'BaseBranch' was defined in the Variables tab | ||
# Variable 'BotAccessToken' was defined in the Variables tab | ||
# Variable 'ServiceName' was defined in the Variables tab | ||
# Multi-job configuration must be converted to matrix strategy: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#multi-job-configuration | ||
resources: | ||
repositories: | ||
- repository: self | ||
type: git | ||
ref: refs/heads/generation | ||
jobs: | ||
- job: Job_1 | ||
displayName: 'Service: ' | ||
timeoutInMinutes: 90 | ||
pool: | ||
name: pool-windows-2019 | ||
steps: | ||
- checkout: self | ||
- task: NodeTool@0 | ||
displayName: Use Node 14.15.5 | ||
inputs: | ||
versionSpec: 14.15.5 | ||
- task: Npm@1 | ||
displayName: Install autorest | ||
inputs: | ||
command: custom | ||
verbose: false | ||
customCommand: install -g autorest@latest | ||
- task: PowerShell@2 | ||
displayName: Generate | ||
inputs: | ||
targetType: inline | ||
script: >- | ||
$subModuleFolders = Get-ChildItem -Directory -Filter *.Autorest | ||
if ($subModuleFolders -eq $null) { | ||
autorest --max-memory-size=8192 | ||
} else { | ||
$subModuleFolders | foreach-object { cd $_.FullName; autorest --max-memory-size=8192} | ||
} | ||
pwsh: true | ||
workingDirectory: src/$(ServiceName)/ | ||
- task: PowerShell@2 | ||
displayName: Build | ||
condition: eq(variables.ServiceSubmoduleName, '') | ||
inputs: | ||
targetType: inline | ||
script: >- | ||
$subModuleFolders = Get-ChildItem -Directory -Filter *.Autorest | ||
if ($subModuleFolders -eq $null) { | ||
./build-module.ps1 | ||
} else { | ||
$subModuleFolders | foreach-object { cd $_.FullName; ./build-module.ps1; cd ..} | ||
} | ||
mkdir ../../artifacts/src/$env:SERVICENAME | ||
cp -r ./* ../../artifacts/src/$env:SERVICENAME | ||
pwsh: true | ||
workingDirectory: src/$(ServiceName) | ||
- task: CmdLine@2 | ||
displayName: Checkout main branch | ||
inputs: | ||
script: > | ||
RMDIR /Q/S src\%SERVICENAME% | ||
git checkout src\%SERVICENAME% | ||
git checkout -b codegen/%SERVICENAME% origin/%BaseBranch% | ||
- task: PowerShell@2 | ||
displayName: Move code to main | ||
condition: eq(variables.ServiceSubmoduleName, '') | ||
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 | ||
$subModuleFolders = Get-ChildItem .\artifacts\src\$env:SERVICENAME -Directory -Filter *.Autorest | ||
if ($subModuleFolders -eq $null) { | ||
Move-Generation2Master -SourcePath .\artifacts\src\$env:SERVICENAME -DestPath .\src\$env:SERVICENAME | ||
} else { | ||
Move-Generation2MasterHybrid -SourcePath .\artifacts\src\$env:SERVICENAME -DestPath .\src\$env: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 $env:SERVICENAME to $env:BaseBranch" | ||
git remote set-url origin https://azure-powershell-bot:$(BotAccessToken)@github.com/Azure/azure-powershell.git | ||
git push origin codegen/$env:SERVICENAME | ||
pwsh: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Variable 'IsGenerateBased' was defined in the Variables tab | ||
# Variable 'NugetSecurityAnalysisWarningLevel' was defined in the Variables tab | ||
# Variable 'OCTOKITPAT' was defined in the Variables tab | ||
# Cron Schedules have been converted using UTC Time Zone and may need to be updated for your location | ||
schedules: | ||
- cron: 0 4 * * 1,2,3,4,5 | ||
branches: | ||
include: | ||
- main | ||
resources: | ||
repositories: | ||
- repository: self | ||
type: git | ||
ref: refs/heads/main | ||
jobs: | ||
- job: Job_1 | ||
displayName: Main | ||
timeoutInMinutes: 120 | ||
pool: | ||
name: pool-windows-2019 | ||
steps: | ||
- checkout: self | ||
fetchTags: false | ||
- task: PowerShell@2 | ||
displayName: Install platyPS | ||
inputs: | ||
targetType: inline | ||
script: Install-Module platyPS -Force -Confirm:$false -Scope CurrentUser | ||
pwsh: true | ||
- task: NodeTool@0 | ||
displayName: Install Node 14.17.1 | ||
condition: eq(variables.IsGenerateBased, true) | ||
inputs: | ||
versionSpec: 14.17.1 | ||
- task: PowerShell@2 | ||
displayName: Install autorest | ||
condition: eq(variables.IsGenerateBased, true) | ||
inputs: | ||
targetType: inline | ||
script: npm install autorest@latest;$env:NODE_OPTIONS="--max-old-space-size=65536" | ||
- task: PowerShell@2 | ||
displayName: Build | ||
inputs: | ||
targetType: inline | ||
script: dotnet msbuilc build.proj /t:"Build;GenerateHelp" /p:"PullRequestNumber=$(System.PullRequest.PullRequestNumber);IsSecurityCheck=true" | ||
env: | ||
OCTOKITPAT: $(OCTOKITPAT) | ||
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2 | ||
displayName: Run CredScan | ||
condition: in(variables['system.pullRequest.targetBranch'], 'generation', 'main') | ||
inputs: | ||
toolMajorVersion: V2 | ||
outputFormat: sarif | ||
scanFolder: SecurityTmp | ||
suppressionsFile: tools/SecurityTools/CredScanSuppressions.json | ||
debugMode: false | ||
folderSuppression: false | ||
- task: PowerShell@2 | ||
displayName: Cleanup Build | ||
inputs: | ||
targetType: inline | ||
script: ./tools/CleanupBuild.ps1 | ||
pwsh: true | ||
- task: PoliCheck@1 | ||
displayName: Run PoliCheck | ||
inputs: | ||
targetArgument: $(Build.SourcesDirectory)/artifacts/Debug | ||
result: $(Build.SourcesDirectory)/artifacts/result/PoliCheck.xml | ||
optionsFTPATH: tools/SecurityTools/PoliCheckFileExtensions.xml | ||
- task: PublishPipelineArtifact@0 | ||
displayName: Save artifacts | ||
condition: succeededOrFailed() | ||
inputs: | ||
artifactName: artifacts | ||
targetPath: artifacts | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.