Skip to content

Commit e5e83f4

Browse files
authored
Add change line to avoid issue (Azure#19495)
* Add change line to avoid issue * Add change line to avoid issue Co-authored-by: wyunchi-ms <[email protected]>
1 parent 977d953 commit e5e83f4

File tree

1 file changed

+44
-61
lines changed

1 file changed

+44
-61
lines changed

.azure-pipelines/code-gen.yml

Lines changed: 44 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -25,72 +25,55 @@ jobs:
2525
command: custom
2626
verbose: false
2727
customCommand: install -g autorest@latest
28-
- task: PowerShell@2
29-
displayName: Generate
30-
inputs:
31-
targetType: inline
32-
script: >-
33-
$subModuleFolders = Get-ChildItem -Directory -Filter *.Autorest
28+
- powershell: |
29+
$subModuleFolders = Get-ChildItem -Directory -Filter *.Autorest
3430
35-
if ($subModuleFolders -eq $null) {
36-
autorest --max-memory-size=8192
37-
} else {
38-
$subModuleFolders | foreach-object { cd $_.FullName; autorest --max-memory-size=8192}
39-
}
40-
pwsh: true
41-
workingDirectory: src/$(ServiceName)/
42-
- task: PowerShell@2
31+
if ($subModuleFolders -eq $null) {
32+
autorest --max-memory-size=8192
33+
} else {
34+
$subModuleFolders | foreach-object { cd $_.FullName; autorest --max-memory-size=8192}
35+
}
36+
workingDirectory: src/$(ServiceName)
37+
displayName: Generate
38+
condition: eq(variables.ServiceSubmoduleName, '')
39+
- powershell: |
40+
$subModuleFolders = Get-ChildItem -Directory -Filter *.Autorest
41+
if ($subModuleFolders -eq $null) {
42+
./build-module.ps1
43+
} else {
44+
$subModuleFolders | foreach-object { cd $_.FullName; ./build-module.ps1; cd ..}
45+
}
46+
mkdir ../../artifacts/src/$env:SERVICENAME
47+
cp -r ./* ../../artifacts/src/$env:SERVICENAME
48+
workingDirectory: src/$(ServiceName)
4349
displayName: Build
4450
condition: eq(variables.ServiceSubmoduleName, '')
45-
inputs:
46-
targetType: inline
47-
script: >-
48-
$subModuleFolders = Get-ChildItem -Directory -Filter *.Autorest
49-
50-
if ($subModuleFolders -eq $null) {
51-
./build-module.ps1
52-
} else {
53-
$subModuleFolders | foreach-object { cd $_.FullName; ./build-module.ps1; cd ..}
54-
}
51+
- powershell: |
52+
mkdir src/$env:SERVICENAME
53+
git checkout src/$env:SERVICENAME
54+
git checkout -b codegen/$env:SERVICENAME origin/$env:BaseBranch
55+
displayName: Checkout main branch
56+
- powershell: |
57+
#Uninstall-Module -Name PackageManagement -AllVersions
58+
Install-Module -Name PowerShellGet -RequiredVersion 2.2.3 -Force
59+
Install-Module -Name platyPS -RequiredVersion 0.14.2 -Force
60+
Install-Module -Name Az.Accounts -Force
61+
Import-Module .\tools\Gen2Master\MoveFromGeneration2Master.ps1
5562
56-
mkdir ../../artifacts/src/$env:SERVICENAME
63+
$subModuleFolders = Get-ChildItem .\artifacts\src\$env:SERVICENAME -Directory -Filter *.Autorest
64+
if ($subModuleFolders -eq $null) {
65+
Move-Generation2Master -SourcePath .\artifacts\src\$env:SERVICENAME -DestPath .\src\$env:SERVICENAME
66+
} else {
67+
Move-Generation2MasterHybrid -SourcePath .\artifacts\src\$env:SERVICENAME -DestPath .\src\$env:SERVICENAME
68+
}
5769
58-
cp -r ./* ../../artifacts/src/$env:SERVICENAME
59-
pwsh: true
60-
workingDirectory: src/$(ServiceName)
61-
- task: PowerShell@2
62-
displayName: Checkout main branch
63-
inputs:
64-
targetType: inline
65-
script: >
66-
mkdir src/$env:SERVICENAME
67-
git checkout src/$env:SERVICENAME
68-
git checkout -b codegen/$env:SERVICENAME origin/$env:BaseBranch
69-
- task: PowerShell@2
70+
git config user.email "[email protected]"
71+
git config user.name "azure-powershell-bot"
72+
git add ./src
73+
git add tools/CreateMappings_rules.json
74+
git commit -m "Move $env:SERVICENAME to $env:BaseBranch"
75+
git remote set-url origin https://azure-powershell-bot:$(BotAccessToken)@github.com/Azure/azure-powershell.git
76+
git push origin codegen/$env:SERVICENAME
7077
displayName: Move code to main
7178
condition: eq(variables.ServiceSubmoduleName, '')
72-
inputs:
73-
targetType: inline
74-
script: >-
75-
#Uninstall-Module -Name PackageManagement -AllVersions
76-
Install-Module -Name PowerShellGet -RequiredVersion 2.2.3 -Force
77-
Install-Module -Name platyPS -RequiredVersion 0.14.2 -Force
78-
Install-Module -Name Az.Accounts -Force
79-
Import-Module .\tools\Gen2Master\MoveFromGeneration2Master.ps1
80-
81-
$subModuleFolders = Get-ChildItem .\artifacts\src\$env:SERVICENAME -Directory -Filter *.Autorest
82-
if ($subModuleFolders -eq $null) {
83-
Move-Generation2Master -SourcePath .\artifacts\src\$env:SERVICENAME -DestPath .\src\$env:SERVICENAME
84-
} else {
85-
Move-Generation2MasterHybrid -SourcePath .\artifacts\src\$env:SERVICENAME -DestPath .\src\$env:SERVICENAME
86-
}
87-
88-
git config user.email "[email protected]"
89-
git config user.name "azure-powershell-bot"
90-
git add ./src
91-
git add tools/CreateMappings_rules.json
92-
git commit -m "Move $env:SERVICENAME to $env:BaseBranch"
93-
git remote set-url origin https://azure-powershell-bot:$(BotAccessToken)@github.com/Azure/azure-powershell.git
94-
git push origin codegen/$env:SERVICENAME
95-
pwsh: true
9679

0 commit comments

Comments
 (0)