1+ # This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
2+ # Please make sure to check all the converted content, it is your team's responsibility to make sure that the pipeline is still valid and functions as expected.
3+ # This pipeline will be extended to the OneESPT template
4+ # If you are not using the E+D shared hosted pool with windows-2022, replace the pool section with your hosted pool, os, and image name. If you are using a Linux image, you must specify an additional windows image for SDL: https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/sdlanalysis/overview#how-to-specify-a-windows-pool-for-the-sdl-source-analysis-stage
5+ # The Task 'PublishBuildArtifacts@1' has been converted to an output named 'Publish Module Artifacts' in the templateContext section.
6+ # The Task 'NuGetCommand@2' has been converted to an output named 'Publish NuGet to feed' in the templateContext section.
7+
8+ name : $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
9+ parameters :
10+ - name : BuildAgent
11+ displayName : Build Agent
12+ default : 1es-windows-ps-compute-m
13+ - name : BaseBranch
14+ displayName : Base Branch
15+ default : main
16+ - name : Test
17+ type : boolean
18+ default : true
19+ - name : Pack
20+ type : boolean
21+ default : false
22+ - name : Sign
23+ type : boolean
24+ default : false
25+ - name : BumpModuleVersion
26+ type : boolean
27+ default : false
28+ - name : CreatePullRequest
29+ type : boolean
30+ default : true
31+
32+ variables :
33+ BuildAgent : ${{ parameters.BuildAgent }}
34+ Branch : " ModuleCommandMetadataRefresh"
35+ BaseBranch : ${{ parameters.BaseBranch }}
36+
37+ trigger :
38+ branches :
39+ include :
40+ - main
41+
42+ resources :
43+ repositories :
44+ - repository : 1ESPipelineTemplates
45+ type : git
46+ name : 1ESPipelineTemplates/1ESPipelineTemplates
47+ ref : refs/tags/release
48+ extends :
49+ template : v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
50+ parameters :
51+ pool : $(BuildAgent)
52+ sdl :
53+ binskim :
54+ enabled : false
55+ justificationForDisabling : " Binskim keeps on crashing and failing the weekly build pipeline. Disabling it for now because we are unable to publish the artifacts to internal feeds."
56+ credscan :
57+ suppressionsFile : $(Build.SourcesDirectory)/.azure-pipelines/config/credscan/credscan-suppressions.json
58+ policheck :
59+ exclusionFile : $(Build.SourcesDirectory)/.azure-pipelines/config/policheck/policheck-exclusions.xml
60+ customBuildTags :
61+ - ES365AIMigrationTooling
62+ stages :
63+ - stage : stage
64+ jobs :
65+ - job : CreateMetadataRefreshBranch
66+ displayName : Create Metadata Refresh Branch
67+ timeoutInMinutes : 1200
68+ steps :
69+ - template : .azure-pipelines/common-templates/checkout.yml@self
70+ parameters :
71+ TargetBranch : ${{ parameters.BaseBranch }}
72+ - task : PowerShell@2
73+ name : " ComputeBranch"
74+ displayName : " Compute Module Command Metadata Refresh Branch Name"
75+ inputs :
76+ targetType : inline
77+ script : |
78+ $branch = "{0}/{1}" -f "$(Branch)", (Get-Date -Format yyyyMMddHHmm)
79+ Write-Host "##vso[task.setvariable variable=RefreshBranch;isOutput=true]$branch"
80+ - task : Bash@3
81+ displayName : " Create Module Command Metadata Refresh Branch"
82+ inputs :
83+ targetType : inline
84+ script : |
85+ git status
86+ git branch $(ComputeBranch.RefreshBranch)
87+ git checkout $(ComputeBranch.RefreshBranch)
88+ git status
89+
90+ - job : MsGraphPsSdkModuleCommandMetadataGeneration
91+ dependsOn : CreateMetadataRefreshBranch
92+ displayName : Microsoft Graph PowerShell SDK Generation
93+ condition : succeeded()
94+ timeoutInMinutes : 840
95+ variables :
96+ RefreshBranch : $[ dependencies.CreateMetadataRefreshBranch.outputs['ComputeBranch.RefreshBranch'] ]
97+ steps :
98+ - template : .azure-pipelines/common-templates/checkout.yml@self
99+ parameters :
100+ TargetBranch : $(RefreshBranch)
101+ - template : .azure-pipelines/common-templates/install-tools.yml@self
102+ - template : .azure-pipelines/common-templates/security-pre-checks.yml@self
103+ - template : .azure-pipelines/generation-templates/authentication-module.yml@self
104+ parameters :
105+ Test : ${{ parameters.Test }}
106+ Pack : ${{ parameters.Pack }}
107+ Sign : ${{ parameters.Sign }}
108+ - template : .azure-pipelines/generation-templates/workload-modules.yml@self
109+ parameters :
110+ Test : ${{ parameters.Test }}
111+ Pack : ${{ parameters.Pack }}
112+ Sign : ${{ parameters.Sign }}
113+ - template : .azure-pipelines/generation-templates/meta-module.yml@self
114+ parameters :
115+ Test : ${{ parameters.Test }}
116+ Pack : ${{ parameters.Pack }}
117+ Sign : ${{ parameters.Sign }}
118+ - template : .azure-pipelines/generation-templates/generate-command-metadata.yml@self
119+ - template : .azure-pipelines/common-templates/security-post-checks.yml@self
120+
121+ - ${{ if eq(parameters.BumpModuleVersion, true) }} :
122+ - task : PowerShell@2
123+ name : CalculateAndBumpModuleVersion
124+ displayName : Calculate and bump module version
125+ condition : succeeded()
126+ inputs :
127+ pwsh : true
128+ targetType : inline
129+ script : |
130+ . "$(System.DefaultWorkingDirectory)\tools\Versions\BumpModuleVersion.ps1" -BumpV1Module -BumpBetaModule -BumpAuthModule -Debug
131+ - task : Bash@3
132+ displayName : Push version bump changes
133+ env :
134+ GITHUB_TOKEN : $(GITHUB_TOKEN)
135+ inputs :
136+ targetType : inline
137+ script : |
138+ git status
139+ git add "$(System.DefaultWorkingDirectory)/config/ModuleMetadata.json"
140+ git commit -m 'Bump module versions after metadata generation.'
141+ git push "https://$(GITHUB_TOKEN)@github.com/microsoftgraph/msgraph-sdk-powershell.git"
142+ git status
143+
144+ - ${{ if eq(parameters.CreatePullRequest, true) }} :
145+ - template : .azure-pipelines/common-templates/create-pr.yml@self
146+ parameters :
147+ BaseBranch : $(BaseBranch)
148+ TargetBranch : $(RefreshBranch)
149+ Title : " [v2] Module Command Metadata Refresh"
150+ Body : " This pull request was automatically created by Azure Pipelines. **Important** Check for unexpected deletions or changes in this PR."
0 commit comments