Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
ea7be88
Adding OneBranch pipeline YAML config file for PowerShell-Coordinated…
Mar 12, 2024
951b4e4
OneBranch pipeline from migrator
adityapatwardhan Mar 12, 2024
1c975bd
Fix yaml error
adityapatwardhan Mar 12, 2024
70ffc8f
Fix yaml 2
adityapatwardhan Mar 12, 2024
0fcfe92
Fix yaml paths
adityapatwardhan Mar 12, 2024
6d7678d
Fix yaml paths 2
adityapatwardhan Mar 12, 2024
11bf6e3
fix typo
adityapatwardhan Mar 12, 2024
296eec7
fix typo 2
adityapatwardhan Mar 12, 2024
d0e55eb
Remove packaging
adityapatwardhan Mar 12, 2024
5f76e84
Fix yaml for checkAzureContainer.yml
adityapatwardhan Mar 12, 2024
ae85a45
Use new service connection
adityapatwardhan Mar 12, 2024
f03ca8d
Hard code the service connection name
adityapatwardhan Mar 12, 2024
2b6a446
Add missing variables
adityapatwardhan Mar 13, 2024
d725fe7
Add Az.Accounts
adityapatwardhan Mar 13, 2024
14cc4a3
Add Az.Storage
adityapatwardhan Mar 13, 2024
0066e17
Multiple path and service connection fixes
adityapatwardhan Mar 13, 2024
5bc98b5
upload build json to ob drop location
adityapatwardhan Mar 13, 2024
7b2c352
Create drop folder
adityapatwardhan Mar 13, 2024
757d85c
Use drop folder
adityapatwardhan Mar 13, 2024
6540a24
Disable some compliance on first stage
adityapatwardhan Mar 13, 2024
785c0b9
Fix linux pool type
adityapatwardhan Mar 13, 2024
c2648e2
Fix current user on linux
adityapatwardhan Mar 13, 2024
a9c5be6
Fix repo root for tests
adityapatwardhan Mar 13, 2024
ea96825
Fix mac os host
adityapatwardhan Mar 13, 2024
d94f420
Fix test artifacts bootstrap
adityapatwardhan Mar 13, 2024
2807218
Fix windows upload
adityapatwardhan Mar 13, 2024
6f2e2c9
Fix test artifacts
adityapatwardhan Mar 13, 2024
23d7c70
Test copy linux tar
adityapatwardhan Mar 13, 2024
4b0ea52
Fix test artifacts bootstrap
adityapatwardhan Mar 13, 2024
8c38927
Fix test non-windows test artifacts
adityapatwardhan Mar 13, 2024
9391ba5
Fix test releases artifact and linux and windows
adityapatwardhan Mar 13, 2024
00a0f51
Multiple fixes
adityapatwardhan Mar 14, 2024
a3772b4
Fix tsaoptions file path
adityapatwardhan Mar 14, 2024
83d6517
Add tsaoptions.json and tasks before restore phase
adityapatwardhan Mar 14, 2024
18e5c88
Fix indent
adityapatwardhan Mar 14, 2024
9f6de48
Multiple fixes
adityapatwardhan Mar 14, 2024
674904a
Fix env
adityapatwardhan Mar 14, 2024
d397b50
Fix typo
adityapatwardhan Mar 14, 2024
ed1869e
Fix env setting
adityapatwardhan Mar 14, 2024
db08f26
Add debug for tsaoptions json
adityapatwardhan Mar 14, 2024
55755ab
Add debug for tsaoptions json 2
adityapatwardhan Mar 14, 2024
4d9eb50
Fix tsaoption
adityapatwardhan Mar 14, 2024
baad494
Fix tsaoption 2
adityapatwardhan Mar 14, 2024
a2c58a5
Global credscan suppression
adityapatwardhan Mar 14, 2024
27432d4
Fix suppress file path
adityapatwardhan Mar 14, 2024
e8b823e
Fix indent
adityapatwardhan Mar 14, 2024
3f8899c
Global tsaoption file
adityapatwardhan Mar 14, 2024
a5c0957
Add package name for sbom
adityapatwardhan Mar 14, 2024
a7db3a3
Disable APIScan for build
adityapatwardhan Mar 14, 2024
defa28c
Restructure windows
adityapatwardhan Mar 14, 2024
6aad6d3
Fix params
adityapatwardhan Mar 14, 2024
72e20cd
Remove parentjob
adityapatwardhan Mar 14, 2024
5ebaa09
Remove params
adityapatwardhan Mar 14, 2024
75a8abd
Build windows
adityapatwardhan Mar 15, 2024
b0eeddf
Add windows signing
adityapatwardhan Mar 15, 2024
3603d88
Move tsaoptions.json to .config
adityapatwardhan Mar 15, 2024
372b207
Fix variable name
adityapatwardhan Mar 15, 2024
67cb9c3
Add tsa config path
adityapatwardhan Mar 15, 2024
ecc68b8
Remove global tsaconfig path
adityapatwardhan Mar 15, 2024
8d3b638
Multiple fixes
adityapatwardhan Mar 15, 2024
72d5a31
Add suppression file to job
adityapatwardhan Mar 15, 2024
8ea87bd
Add suppression file to job
adityapatwardhan Mar 15, 2024
9cfcb85
Add debug
adityapatwardhan Mar 15, 2024
7538243
Try to fix credscan setting
adityapatwardhan Mar 16, 2024
42e56b3
Move credscan suppress to .config
adityapatwardhan Mar 16, 2024
9f408a3
Temporary disable credscan
adityapatwardhan Mar 18, 2024
9a5642e
Add suppress.csk
adityapatwardhan Mar 18, 2024
50b66d7
Remove workaround
adityapatwardhan Mar 18, 2024
767697a
Add variable for credscan suppression
adityapatwardhan Mar 18, 2024
0d90c9d
Disable armory
adityapatwardhan Mar 18, 2024
4338439
Fix test and windows
adityapatwardhan Mar 18, 2024
04517b7
Move armory disablement to globalsdl
adityapatwardhan Mar 18, 2024
dafe4fb
Add suppression for create release json job
adityapatwardhan Mar 18, 2024
7132650
Try to fix tsaoptions for async sdl
adityapatwardhan Mar 18, 2024
bd8ec02
signing issues
adityapatwardhan Mar 18, 2024
c124c00
tsa and signing on windows
adityapatwardhan Mar 18, 2024
03e276d
unique job name and get-authenticodesignature
adityapatwardhan Mar 18, 2024
a7152c4
Try to fix job name
adityapatwardhan Mar 18, 2024
8630ca5
Windows refactor and linux codeQL
adityapatwardhan Mar 18, 2024
5781ee4
Fix variables and job name
adityapatwardhan Mar 19, 2024
7c27228
Check pdbs for windows
adityapatwardhan Mar 19, 2024
f039aca
Refactor linux
adityapatwardhan Mar 19, 2024
3a97bcc
Fix indent
adityapatwardhan Mar 19, 2024
ae17581
Fix job name
adityapatwardhan Mar 19, 2024
2741bca
Fix job name and parameter mapping
adityapatwardhan Mar 20, 2024
85e67c4
Fix signing
adityapatwardhan Mar 20, 2024
bf4c8bb
Fixes
adityapatwardhan Mar 20, 2024
05bdad7
Fix paths
adityapatwardhan Mar 20, 2024
225f453
Fix parameter and directory separator issue
adityapatwardhan Mar 20, 2024
27fc26a
Fix typo
adityapatwardhan Mar 20, 2024
3fbbce0
Multiple fixes
adityapatwardhan Mar 20, 2024
c86681d
Restructure signing
adityapatwardhan Mar 20, 2024
907c227
Fix typo
adityapatwardhan Mar 20, 2024
2f555ce
Debug
adityapatwardhan Mar 20, 2024
bbee2de
Add logging
adityapatwardhan Mar 20, 2024
79e3dc8
Fix copy
adityapatwardhan Mar 20, 2024
a1088a6
Fix directory separator on windows
adityapatwardhan Mar 21, 2024
779486d
Fixes
adityapatwardhan Mar 21, 2024
bcf960d
Fix variable in condition and no lower on non-windows
adityapatwardhan Mar 21, 2024
ece5779
Fix typo
adityapatwardhan Mar 21, 2024
38cae4a
Fix debug
adityapatwardhan Mar 21, 2024
2a733d7
Fix parenthesis
adityapatwardhan Mar 21, 2024
7a16361
Fix typo
adityapatwardhan Mar 21, 2024
e8ba95c
Fix artifactplatform
adityapatwardhan Mar 21, 2024
b7a2bcb
Fix issues
adityapatwardhan Mar 21, 2024
a5e80f2
Disable codeQL
adityapatwardhan Mar 21, 2024
ed339f2
Fix typo
adityapatwardhan Mar 21, 2024
548457b
Dont publish to output folder for linux
adityapatwardhan Mar 21, 2024
4c8da3b
Disable codeQL on prep stage
adityapatwardhan Mar 21, 2024
862854b
Disable codeQL task
adityapatwardhan Mar 21, 2024
7567cd2
Fix signing
adityapatwardhan Mar 21, 2024
66f8528
Add linux authenticode signing
adityapatwardhan Mar 22, 2024
d32b25f
Fix typo and add finalize step
adityapatwardhan Mar 22, 2024
b2834d2
Fix typo in parameter
adityapatwardhan Mar 22, 2024
6a77f0e
Add capture
adityapatwardhan Mar 22, 2024
96e986e
Fix job name
adityapatwardhan Mar 22, 2024
d591756
Fix job name and add back linux upload
adityapatwardhan Mar 22, 2024
6d9a8b0
Fix powershell root
adityapatwardhan Mar 22, 2024
af8c25c
Fix powershell root for prep stage
adityapatwardhan Mar 22, 2024
f4b3cf3
Skip signing pwsh on linux
adityapatwardhan Mar 22, 2024
c2b62da
Cleanup
adityapatwardhan Mar 22, 2024
61e3de0
Address Code review feedback
adityapatwardhan Mar 22, 2024
aa5d942
Remove comment
adityapatwardhan Mar 23, 2024
a3d403b
Add mac file signing
adityapatwardhan Mar 23, 2024
a086ad9
Fix typo
adityapatwardhan Mar 23, 2024
6ff417f
Fix path for expand
adityapatwardhan Mar 23, 2024
d6c3415
Fix typo
adityapatwardhan Mar 23, 2024
d9e7fca
Fix runtime variable
adityapatwardhan Mar 23, 2024
b6efa29
Update tsaoptions.json
adityapatwardhan Mar 25, 2024
d2d74ba
Address feedback
adityapatwardhan Mar 25, 2024
1160c1c
Clean up unused files
adityapatwardhan Mar 25, 2024
2038993
Merge branch 'OBP_Official_adityap_TeNzR3' of https://github.com/adit…
adityapatwardhan Mar 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .config/suppress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"tool": "Credential Scanner",
"suppressions": [
{
"file": "\\test\\tools\\Modules\\WebListener\\ClientCert.pfx",
"_justification": "Test certificate with private key"
},
{
"file": "\\test\\tools\\Modules\\WebListener\\ServerCert.pfx",
"_justification": "Test certificate with private key"
},
{
"file": "\\test\\powershell\\Modules\\Microsoft.PowerShell.Security\\certificateCommon.psm1",
"_justification": "Test certificate with private key and inline suppression isn't working"
}
]
}
5 changes: 5 additions & 0 deletions .config/tsaoptions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"instanceUrl": "https://msazure.visualstudio.com",
"projectName": "One",
"areaPath": "One\\MGMT\\Compute\\Powershell\\Powershell\\PowerShell Core"
}
251 changes: 251 additions & 0 deletions .pipelines/PowerShell-Coordinated_Packages-Official.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
name: UnifiedPackageBuild-$(Build.BuildId)
trigger:
branches:
include:
- master
- release*
pr:
branches:
include:
- master
- release*

parameters:
- name: ForceAzureBlobDelete
displayName: Delete Azure Blob
type: string
values:
- true
- false
default: false
- name: InternalSDKBlobURL
displayName: URL to the blob having internal .NET SDK
type: string
default: ' '
- name: ReleaseTagVar
displayName: Release Tag
type: string
default: 'fromBranch'
- name: SKIP_SIGNING
displayName: Skip Signing
type: string
default: 'NO'

resources:
repositories:
- repository: ComplianceRepo
type: github
endpoint: ComplianceGHRepo
name: PowerShell/compliance
ref: master
- repository: onebranchTemplates
type: git
name: OneBranch.Pipelines/GovernedTemplates
ref: refs/heads/main

variables:
- name: PS_RELEASE_BUILD
value: 1
- name: DOTNET_CLI_TELEMETRY_OPTOUT
value: 1
- name: POWERSHELL_TELEMETRY_OPTOUT
value: 1
- name: nugetMultiFeedWarnLevel
value: none
- name: NugetSecurityAnalysisWarningLevel
value: none
- name: skipNugetSecurityAnalysis
value: true
Comment on lines +53 to +58
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a new PR, we should try to remove these by using the restore phase.

- name: branchCounterKey
value: $[format('{0:yyyyMMdd}-{1}', pipeline.startTime,variables['Build.SourceBranch'])]
- name: branchCounter
value: $[counter(variables['branchCounterKey'], 1)]
- name: ForceAzureBlobDelete
value: ${{ parameters.ForceAzureBlobDelete }}
- name: BUILDSECMON_OPT_IN
value: true
- name: __DOTNET_RUNTIME_FEED
value: ${{ parameters.InternalSDKBlobURL }}
- name: LinuxContainerImage
value: onebranch.azurecr.io/linux/ubuntu-2004:latest
- name: WindowsContainerImage
value: onebranch.azurecr.io/windows/ltsc2019/vse2022:latest
- name: CDP_DEFINITION_BUILD_COUNT
value: $[counter('', 0)]
- name: ReleaseTagVar
value: ${{ parameters.ReleaseTagVar }}
- name: SKIP_SIGNING
value: ${{ parameters.SKIP_SIGNING }}
- group: 'AzDevOpsArtifacts'

extends:
template: v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates
parameters:
customTags: 'ES365AIMigrationTooling'
globalSdl:
disableLegacyManifest: true
# disabled Armorty as we dont have any ARM templates to scan. It fails on some sample ARM templates.
armory:
enabled: false
sbom:
enabled: true
compiled:
${{ if eq(variables['Build.SourceBranch'], 'refs/heads/master') }}:
enabled: true
${{ else }}:
enabled: false
credscan:
enabled: true
scanFolder: $(Build.SourcesDirectory)
suppressionsFile: $(Build.SourcesDirectory)\.config\suppress.json
cg:
enabled: true
ignoreDirectories: '.devcontainer,demos,docker,docs,src,test,tools/packaging'
asyncSdl: # https://aka.ms/obpipelines/asyncsdl
enabled: true
forStages: [prep, macos, linux, windows, SignFiles, test_and_release_artifacts]
credscan:
enabled: true
scanFolder: $(Build.SourcesDirectory)
suppressionsFile: $(Build.SourcesDirectory)\PowerShell\.config\suppress.json
binskim:
enabled: false
# APIScan requires a non-Ready-To-Run build
apiscan:
enabled: false
tsaOptionsFile: .config\tsaoptions.json

stages:
- stage: prep
jobs:
- template: /.pipelines/templates/checkAzureContainer.yml@self

- stage: macos
displayName: macOS - build and sign
dependsOn: ['prep']
jobs:
- template: /.pipelines/templates/mac.yml@self
parameters:
buildArchitecture: x64
- template: /.pipelines/templates/mac.yml@self
parameters:
buildArchitecture: arm64

- stage: linux
displayName: linux - build and sign
dependsOn: ['prep']
jobs:
- template: /.pipelines/templates/linux.yml@self
parameters:
Runtime: 'linux-x64'
JobName: 'linux_x64'

- template: /.pipelines/templates/linux.yml@self
parameters:
Runtime: 'linux-x64'
JobName: 'linux_x64_minSize'
BuildConfiguration: 'minSize'

- template: /.pipelines/templates/linux.yml@self
parameters:
Runtime: 'linux-arm'
JobName: 'linux_arm'

- template: /.pipelines/templates/linux.yml@self
parameters:
Runtime: 'linux-arm64'
JobName: 'linux_arm64'

- template: /.pipelines/templates/linux.yml@self
parameters:
Runtime: 'fxdependent-linux-x64'
JobName: 'linux_fxd_x64_mariner'

- template: /.pipelines/templates/linux.yml@self
parameters:
Runtime: 'fxdependent-linux-arm64'
JobName: 'linux_fxd_arm64_mariner'

- template: /.pipelines/templates/linux.yml@self
parameters:
Runtime: 'fxdependent-noopt-linux-musl-x64'
JobName: 'linux_fxd_x64_alpine'

- template: /.pipelines/templates/linux.yml@self
parameters:
Runtime: 'fxdependent'
JobName: 'linux_fxd'

- template: /.pipelines/templates/linux.yml@self
parameters:
Runtime: 'linux-musl-x64'
JobName: 'linux_x64_alpine'

- stage: windows
displayName: windows - build and sign
dependsOn: ['prep']
jobs:
- template: /.pipelines/templates/windows-hosted-build.yml@self
parameters:
Architecture: x64
BuildConfiguration: release
JobName: build_windows_x64_release
- template: /.pipelines/templates/windows-hosted-build.yml@self
parameters:
Architecture: x64
BuildConfiguration: minSize
JobName: build_windows_x64_minSize
- template: /.pipelines/templates/windows-hosted-build.yml@self
parameters:
Architecture: x86
JobName: build_windows_x86_release
- template: /.pipelines/templates/windows-hosted-build.yml@self
parameters:
Architecture: arm64
JobName: build_windows_arm64_release
- template: /.pipelines/templates/windows-hosted-build.yml@self
parameters:
Architecture: fxdependent
JobName: build_windows_fxdependent_release
- template: /.pipelines/templates/windows-hosted-build.yml@self
parameters:
Architecture: fxdependentWinDesktop
JobName: build_windows_fxdependentWinDesktop_release

- stage: test_and_release_artifacts
displayName: Test and Release Artifacts
dependsOn: ['prep']
jobs:
- template: /.pipelines/templates/testartifacts.yml@self

- job: release_json
displayName: Create and Upload release.json
pool:
type: windows
variables:
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
- name: ob_sdl_tsa_configFile
value: $(Build.SourcesDirectory)\PowerShell\.config\tsaoptions.json
- name: ob_sdl_credscan_suppressionsFile
value: $(Build.SourcesDirectory)\PowerShell\.config\suppress.json
steps:
- checkout: self
clean: true
- template: /.pipelines/templates/SetVersionVariables.yml@self
parameters:
ReleaseTagVar: $(ReleaseTagVar)
- powershell: |
$metadata = Get-Content '$(Build.SourcesDirectory)/PowerShell/tools/metadata.json' -Raw | ConvertFrom-Json
$LTS = $metadata.LTSRelease.Package
@{ ReleaseVersion = "$(Version)"; LTSRelease = $LTS } | ConvertTo-Json | Out-File "$(Build.StagingDirectory)\release.json"
Get-Content "$(Build.StagingDirectory)\release.json"

if (-not (Test-Path "$(ob_outputDirectory)\metadata")) {
New-Item -ItemType Directory -Path "$(ob_outputDirectory)\metadata"
}

Copy-Item -Path "$(Build.StagingDirectory)\release.json" -Destination "$(ob_outputDirectory)\metadata" -Force
displayName: Create and upload release.json file to build artifact
retryCountOnTaskFailure: 2
- template: /.pipelines/templates/step/finalize.yml@self
68 changes: 68 additions & 0 deletions .pipelines/templates/SetVersionVariables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
parameters:
ReleaseTagVar: v6.2.0
ReleaseTagVarName: ReleaseTagVar
CreateJson: 'no'
UseJson: 'yes'

steps:
- ${{ if eq(parameters['UseJson'],'yes') }}:
- task: DownloadBuildArtifacts@0
inputs:
artifactName: 'drop_prep_DeleteBlob'
itemPattern: '*.json'
downloadPath: '$(System.ArtifactsDirectory)'
displayName: Download Build Info Json
env:
ob_restore_phase: true # This ensures checkout is done at the beginning of the restore phase

- powershell: |
$path = "./build.psm1"
if($env:REPOROOT){
Write-Verbose "reporoot already set to ${env:REPOROOT}" -Verbose
exit 0
}
if(Test-Path -Path $path)
{
Write-Verbose "reporoot detect at: ." -Verbose
$repoRoot = '.'
}
else{
$path = "./PowerShell/build.psm1"
if(Test-Path -Path $path)
{
Write-Verbose "reporoot detect at: ./PowerShell" -Verbose
$repoRoot = './PowerShell'
}
}
if($repoRoot) {
$vstsCommandString = "vso[task.setvariable variable=repoRoot]$repoRoot"
Write-Host ("sending " + $vstsCommandString)
Write-Host "##$vstsCommandString"
} else {
Write-Verbose -Verbose "repo not found"
}
displayName: 'Set repo Root'
env:
ob_restore_phase: true # This ensures checkout is done at the beginning of the restore phase

- powershell: |
$createJson = ("${{ parameters.CreateJson }}" -ne "no")
$releaseTag = & "$env:REPOROOT/tools/releaseBuild/setReleaseTag.ps1" -ReleaseTag ${{ parameters.ReleaseTagVar }} -Variable "${{ parameters.ReleaseTagVarName }}" -CreateJson:$createJson
$version = $releaseTag.Substring(1)
$vstsCommandString = "vso[task.setvariable variable=Version]$version"
Write-Host ("sending " + $vstsCommandString)
Write-Host "##$vstsCommandString"
$azureVersion = $releaseTag.ToLowerInvariant() -replace '\.', '-'
$vstsCommandString = "vso[task.setvariable variable=AzureVersion]$azureVersion"
Write-Host ("sending " + $vstsCommandString)
Write-Host "##$vstsCommandString"
displayName: 'Set ${{ parameters.ReleaseTagVarName }} and other version Variables'
env:
ob_restore_phase: true # This ensures checkout is done at the beginning of the restore phase

- powershell: |
Get-ChildItem -Path env:
displayName: Capture environment
condition: succeededOrFailed()
env:
ob_restore_phase: true # This ensures checkout is done at the beginning of the restore phase
Loading