2018-12-05 23:47:54 +01:00
|
|
|
parameters:
|
|
|
|
buildName: ''
|
2019-06-27 19:21:44 +02:00
|
|
|
uploadDisplayName: 'Upload'
|
2020-06-09 03:06:48 +02:00
|
|
|
parentJob: ''
|
2018-11-05 19:35:53 +01:00
|
|
|
|
2018-12-05 23:47:54 +01:00
|
|
|
jobs:
|
|
|
|
- job: build_${{ parameters.buildName }}
|
|
|
|
displayName: Build ${{ parameters.buildName }}
|
2018-11-05 19:35:53 +01:00
|
|
|
condition: succeeded()
|
2020-11-23 23:50:00 +01:00
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-16.04
|
2020-06-09 03:06:48 +02:00
|
|
|
dependsOn: ${{ parameters.parentJob }}
|
2018-12-05 23:47:54 +01:00
|
|
|
variables:
|
2020-11-23 23:50:00 +01:00
|
|
|
- name: runCodesignValidationInjection
|
|
|
|
value: false
|
|
|
|
- name: build
|
|
|
|
value: ${{ parameters.buildName }}
|
2021-03-02 01:33:22 +01:00
|
|
|
- name: NugetSecurityAnalysisWarningLevel
|
|
|
|
value: none
|
2020-11-23 23:50:00 +01:00
|
|
|
- group: ESRP
|
|
|
|
|
2018-11-05 19:35:53 +01:00
|
|
|
steps:
|
2020-10-23 20:42:24 +02:00
|
|
|
- checkout: self
|
|
|
|
clean: true
|
2018-11-05 19:35:53 +01:00
|
|
|
|
2020-12-07 21:11:54 +01:00
|
|
|
- checkout: ComplianceRepo
|
|
|
|
clean: true
|
|
|
|
|
2019-02-01 00:10:19 +01:00
|
|
|
- template: SetVersionVariables.yml
|
|
|
|
parameters:
|
|
|
|
ReleaseTagVar: $(ReleaseTagVar)
|
2018-11-05 19:35:53 +01:00
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
Write-Verbose -Verbose "$(build)"
|
|
|
|
|
2018-12-05 23:47:54 +01:00
|
|
|
if ('$(build)' -in 'alpine', 'fxdependent' -and '$(ReleaseTagVar)' -match '6.0.*')
|
2018-11-05 19:35:53 +01:00
|
|
|
{
|
2018-12-05 23:47:54 +01:00
|
|
|
$vstsCommandString = "vso[task.setvariable variable=SkipBuild]true"
|
2018-11-05 19:35:53 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-12-05 23:47:54 +01:00
|
|
|
$vstsCommandString = "vso[task.setvariable variable=SkipBuild]false"
|
2018-11-05 19:35:53 +01:00
|
|
|
}
|
2018-12-05 23:47:54 +01:00
|
|
|
displayName: 'Skip Alpine or fxdependent for PS v6.0.*'
|
|
|
|
|
2019-02-01 19:59:01 +01:00
|
|
|
- template: insert-nuget-config-azfeed.yml
|
2020-12-14 23:16:55 +01:00
|
|
|
parameters:
|
|
|
|
repoRoot: $(REPOROOT)
|
2018-11-05 19:35:53 +01:00
|
|
|
|
|
|
|
- powershell: |
|
2020-11-23 23:50:00 +01:00
|
|
|
import-module "$env:REPOROOT/build.psm1"
|
2018-11-05 19:35:53 +01:00
|
|
|
Sync-PSTags -AddRemoteIfMissing
|
|
|
|
displayName: SyncTags
|
2018-12-05 23:47:54 +01:00
|
|
|
condition: and(succeeded(), ne(variables['SkipBuild'], 'true'))
|
2018-11-05 19:35:53 +01:00
|
|
|
|
|
|
|
- powershell: |
|
2020-12-14 23:16:55 +01:00
|
|
|
$env:AzDevOpsFeedPAT2 = '$(AzDevOpsFeedPAT2)'
|
2020-11-23 23:50:00 +01:00
|
|
|
& "$env:REPOROOT/tools/releaseBuild/vstsbuild.ps1" -ReleaseTag $(ReleaseTagVar) -Name '$(build)'
|
2020-12-14 23:16:55 +01:00
|
|
|
$env:AzDevOpsFeedPAT2 = $null
|
2020-02-05 01:21:59 +01:00
|
|
|
|
2018-11-05 19:35:53 +01:00
|
|
|
displayName: 'Build and package'
|
2018-12-05 23:47:54 +01:00
|
|
|
condition: and(succeeded(), ne(variables['SkipBuild'], 'true'))
|
2018-11-05 19:35:53 +01:00
|
|
|
|
2018-12-05 23:47:54 +01:00
|
|
|
- job: upload_${{ parameters.buildName }}
|
2019-06-27 19:21:44 +02:00
|
|
|
displayName: ${{ parameters.uploadDisplayName }} ${{ parameters.buildName }}
|
2018-12-05 23:47:54 +01:00
|
|
|
dependsOn: build_${{ parameters.buildName }}
|
2018-11-05 19:35:53 +01:00
|
|
|
condition: succeeded()
|
2020-11-23 23:50:00 +01:00
|
|
|
pool:
|
|
|
|
vmImage: windows-latest
|
2018-12-05 23:47:54 +01:00
|
|
|
variables:
|
2020-11-23 23:50:00 +01:00
|
|
|
- name: buildName
|
|
|
|
value: ${{ parameters.buildName }}
|
|
|
|
- group: ESRP
|
2021-02-23 01:39:02 +01:00
|
|
|
- name: runCodesignValidationInjection
|
|
|
|
value: false
|
2021-03-02 01:33:22 +01:00
|
|
|
- name: NugetSecurityAnalysisWarningLevel
|
|
|
|
value: none
|
2020-11-23 23:50:00 +01:00
|
|
|
|
2018-11-05 19:35:53 +01:00
|
|
|
steps:
|
2020-11-23 23:50:00 +01:00
|
|
|
- checkout: self
|
|
|
|
clean: true
|
|
|
|
|
|
|
|
- checkout: ComplianceRepo
|
|
|
|
clean: true
|
2018-11-05 19:35:53 +01:00
|
|
|
|
2019-02-01 00:10:19 +01:00
|
|
|
- template: SetVersionVariables.yml
|
|
|
|
parameters:
|
|
|
|
ReleaseTagVar: $(ReleaseTagVar)
|
2021-06-24 21:17:50 +02:00
|
|
|
- template: shouldSign.yml
|
2018-11-05 19:35:53 +01:00
|
|
|
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
displayName: 'Download Deb Artifacts'
|
|
|
|
inputs:
|
|
|
|
downloadType: specific
|
|
|
|
itemPattern: '**/*.deb'
|
|
|
|
downloadPath: '$(System.ArtifactsDirectory)\finished'
|
2021-03-12 22:25:30 +01:00
|
|
|
condition: and(eq(variables['buildName'], 'DEB'), succeeded())
|
2018-11-05 19:35:53 +01:00
|
|
|
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
displayName: 'Download tar.gz Artifacts copy'
|
|
|
|
inputs:
|
|
|
|
downloadType: specific
|
|
|
|
itemPattern: '**/*.tar.gz'
|
|
|
|
downloadPath: '$(System.ArtifactsDirectory)\finished'
|
|
|
|
|
2021-03-12 22:25:30 +01:00
|
|
|
- powershell: |
|
|
|
|
Write-Host 'We handle the min-size package only when uploading for deb build.'
|
|
|
|
Write-Host '- For deb build, the min-size package is moved to a separate folder "finished\minSize",'
|
|
|
|
Write-Host ' so that the min-size package can be uploaded to a different Az Blob container.'
|
|
|
|
Write-Host '- For other builds, the min-size package is removed after being downloaded, so that it'
|
|
|
|
Write-Host ' does not get accidentally uploaded to the wrong Az Blob container.'
|
|
|
|
|
|
|
|
$minSizePkg = '$(System.ArtifactsDirectory)\finished\release\*-gc.tar.gz'
|
|
|
|
if (Test-Path -Path $minSizePkg)
|
|
|
|
{
|
|
|
|
if ('$(buildName)' -eq 'DEB')
|
|
|
|
{
|
|
|
|
$minSizeDir = '$(System.ArtifactsDirectory)\finished\minSize'
|
|
|
|
New-Item -Path $minSizeDir -Type Directory -Force > $null
|
|
|
|
Move-Item -Path $minSizePkg -Destination $minSizeDir
|
|
|
|
|
|
|
|
Write-Host "`nCapture the min-size package moved to the target folder."
|
|
|
|
Get-ChildItem -Path $minSizeDir
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Write-Host '$(buildName): Remove the min-size package.'
|
|
|
|
Remove-Item -Path $minSizePkg -Force
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Write-Host 'min-size package not found, so skip this step.'
|
|
|
|
}
|
|
|
|
displayName: 'Move minSize package to separate folder'
|
|
|
|
|
2018-11-05 19:35:53 +01:00
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
displayName: 'Download rpm Artifacts copy'
|
|
|
|
inputs:
|
|
|
|
downloadType: specific
|
|
|
|
itemPattern: '**/*.rpm'
|
|
|
|
downloadPath: '$(System.ArtifactsDirectory)\rpm'
|
2021-03-12 22:25:30 +01:00
|
|
|
condition: and(eq(variables['buildName'], 'RPM'), succeeded())
|
2018-11-05 19:35:53 +01:00
|
|
|
|
2020-12-07 21:11:54 +01:00
|
|
|
- template: EsrpScan.yml@ComplianceRepo
|
|
|
|
parameters:
|
|
|
|
scanPath: $(System.ArtifactsDirectory)
|
|
|
|
pattern: |
|
|
|
|
**\*.rpm
|
|
|
|
**\*.deb
|
|
|
|
**\*.tar.gz
|
2020-11-23 23:50:00 +01:00
|
|
|
|
|
|
|
- ${{ if eq(variables['buildName'], 'RPM') }}:
|
|
|
|
- template: EsrpSign.yml@ComplianceRepo
|
|
|
|
parameters:
|
|
|
|
buildOutputPath: $(System.ArtifactsDirectory)\rpm
|
|
|
|
signOutputPath: $(Build.StagingDirectory)\signedPackages
|
|
|
|
certificateId: "CP-450779-Pgp"
|
|
|
|
pattern: |
|
|
|
|
**\*.rpm
|
|
|
|
useMinimatch: true
|
2020-12-09 23:51:43 +01:00
|
|
|
shouldSign: $(SHOULD_SIGN)
|
2021-04-09 19:26:47 +02:00
|
|
|
displayName: Sign RPM
|
2020-11-23 23:50:00 +01:00
|
|
|
|
|
|
|
# requires windows
|
2020-07-14 21:08:45 +02:00
|
|
|
- task: AzureFileCopy@4
|
2019-02-01 19:59:01 +01:00
|
|
|
displayName: 'Upload to Azure - DEB and tar.gz'
|
2018-11-05 19:35:53 +01:00
|
|
|
inputs:
|
2020-07-15 21:45:47 +02:00
|
|
|
SourcePath: '$(System.ArtifactsDirectory)\finished\release\*'
|
2018-11-05 19:35:53 +01:00
|
|
|
azureSubscription: '$(AzureFileCopySubscription)'
|
|
|
|
Destination: AzureBlob
|
|
|
|
storage: '$(StorageAccount)'
|
|
|
|
ContainerName: '$(AzureVersion)'
|
|
|
|
|
2019-02-01 19:59:01 +01:00
|
|
|
- template: upload-final-results.yml
|
|
|
|
parameters:
|
|
|
|
artifactPath: $(System.ArtifactsDirectory)\finished\release
|
|
|
|
|
2021-03-12 22:25:30 +01:00
|
|
|
# requires windows
|
|
|
|
- task: AzureFileCopy@4
|
|
|
|
displayName: 'Upload to Azure - min-size package for Guest Config'
|
|
|
|
inputs:
|
|
|
|
SourcePath: '$(System.ArtifactsDirectory)\finished\minSize\*'
|
|
|
|
azureSubscription: '$(AzureFileCopySubscription)'
|
|
|
|
Destination: AzureBlob
|
|
|
|
storage: '$(StorageAccount)'
|
|
|
|
ContainerName: '$(AzureVersion)-gc'
|
|
|
|
condition: and(eq(variables['buildName'], 'DEB'), succeeded())
|
|
|
|
|
|
|
|
- template: upload-final-results.yml
|
|
|
|
parameters:
|
|
|
|
artifactPath: $(System.ArtifactsDirectory)\finished\minSize
|
|
|
|
condition: and(eq(variables['buildName'], 'DEB'), succeeded())
|
|
|
|
|
2020-11-23 23:50:00 +01:00
|
|
|
# requires windows
|
2020-07-14 21:08:45 +02:00
|
|
|
- task: AzureFileCopy@4
|
2019-06-27 19:21:44 +02:00
|
|
|
displayName: 'Upload to Azure - RPM - Unsigned'
|
2018-11-05 19:35:53 +01:00
|
|
|
inputs:
|
2020-07-15 21:45:47 +02:00
|
|
|
SourcePath: '$(System.ArtifactsDirectory)\rpm\release\*'
|
2018-11-05 19:35:53 +01:00
|
|
|
azureSubscription: '$(AzureFileCopySubscription)'
|
|
|
|
Destination: AzureBlob
|
|
|
|
storage: '$(StorageAccount)'
|
2019-06-27 19:21:44 +02:00
|
|
|
ContainerName: '$(AzureVersion)'
|
2019-08-28 18:44:02 +02:00
|
|
|
condition: and(and(succeeded(), ne(variables['SHOULD_SIGN'], 'true')),eq(variables['buildName'], 'RPM'))
|
2019-06-27 19:21:44 +02:00
|
|
|
|
2020-11-23 23:50:00 +01:00
|
|
|
# requires windows
|
2020-07-14 21:08:45 +02:00
|
|
|
- task: AzureFileCopy@4
|
2019-06-27 19:21:44 +02:00
|
|
|
displayName: 'Upload to Azure - RPM - Signed'
|
|
|
|
inputs:
|
2020-12-14 22:59:27 +01:00
|
|
|
SourcePath: '$(Build.StagingDirectory)\signedPackages\release\*'
|
2019-06-27 19:21:44 +02:00
|
|
|
azureSubscription: '$(AzureFileCopySubscription)'
|
|
|
|
Destination: AzureBlob
|
|
|
|
storage: '$(StorageAccount)'
|
|
|
|
ContainerName: '$(AzureVersion)'
|
2019-08-28 18:44:02 +02:00
|
|
|
condition: and(and(succeeded(), eq(variables['SHOULD_SIGN'], 'true')),eq(variables['buildName'], 'RPM'))
|
2019-02-01 19:59:01 +01:00
|
|
|
|
|
|
|
- template: upload-final-results.yml
|
|
|
|
parameters:
|
|
|
|
artifactPath: $(System.ArtifactsDirectory)\rpm\release
|
2019-08-28 18:44:02 +02:00
|
|
|
condition: and(and(succeeded(), ne(variables['SHOULD_SIGN'], 'true')),eq(variables['buildName'], 'RPM'))
|
2019-06-27 19:21:44 +02:00
|
|
|
|
|
|
|
- template: upload-final-results.yml
|
|
|
|
parameters:
|
2020-12-14 22:59:27 +01:00
|
|
|
artifactPath: '$(Build.StagingDirectory)\signedPackages\release'
|
2019-08-28 18:44:02 +02:00
|
|
|
condition: and(and(succeeded(), eq(variables['SHOULD_SIGN'], 'true')),eq(variables['buildName'], 'RPM'))
|
2019-03-29 23:18:55 +01:00
|
|
|
|
|
|
|
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
|
|
|
displayName: 'Component Detection'
|
|
|
|
inputs:
|
|
|
|
sourceScanPath: '$(Build.SourcesDirectory)'
|
|
|
|
snapshotForceEnabled: true
|