PowerShell/tools/releaseBuild/azureDevOps/templates/linux.yml

113 lines
3.8 KiB
YAML
Raw Normal View History

parameters:
buildName: ''
jobs:
- job: build_${{ parameters.buildName }}
displayName: Build ${{ parameters.buildName }}
condition: succeeded()
pool: Hosted Ubuntu 1604
variables:
build: ${{ parameters.buildName }}
steps:
- powershell: |
tools/releaseBuild/setReleaseTag.ps1 -ReleaseTag $(ReleaseTagVar) -Variable "ReleaseTagVar"
displayName: 'Run setReleaseTag.ps1'
- powershell: |
Write-Verbose -Verbose "$(build)"
if ('$(build)' -in 'alpine', 'fxdependent' -and '$(ReleaseTagVar)' -match '6.0.*')
{
$vstsCommandString = "vso[task.setvariable variable=SkipBuild]true"
}
else
{
$vstsCommandString = "vso[task.setvariable variable=SkipBuild]false"
}
displayName: 'Skip Alpine or fxdependent for PS v6.0.*'
- powershell: |
Import-Module $(Build.SourcesDirectory)/build.psm1 -Force
New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT) -FeedName AzDevOpsFeed -Destination $(Build.SourcesDirectory)/src/Modules
if(-not (Test-Path "$(Build.SourcesDirectory)/src/Modules/nuget.config"))
{
throw "nuget.config is not created"
}
displayName: 'Add nuget.config for AzDevOps feed for PSGallery modules '
condition: ne(Variables['SkipBuild'],'true')
- powershell: |
import-module ./build.psm1
Sync-PSTags -AddRemoteIfMissing
displayName: SyncTags
condition: and(succeeded(), ne(variables['SkipBuild'], 'true'))
- powershell: |
tools/releaseBuild/vstsbuild.ps1 -ReleaseTag $(ReleaseTagVar) -Name '$(build)'
displayName: 'Build and package'
condition: and(succeeded(), ne(variables['SkipBuild'], 'true'))
- job: upload_${{ parameters.buildName }}
displayName: Upload ${{ parameters.buildName }}
dependsOn: build_${{ parameters.buildName }}
condition: succeeded()
pool: Package ES CodeHub Lab E
variables:
buildName: ${{ parameters.buildName }}
steps:
- powershell: |
tools/releaseBuild/setReleaseTag.ps1 -ReleaseTag $(ReleaseTagVar) -Variable "ReleaseTagVar"
displayName: 'Set ReleaseTag'
- powershell: |
$azureVersion = $env:ReleaseTagVar.ToLowerInvariant() -replace '\.', '-'
$vstsCommandString = "vso[task.setvariable variable=AzureVersion]$azureVersion"
Write-Host "sending " + $vstsCommandString
Write-Host "##$vstsCommandString"
displayName: 'Set Version for Blob Storage'
- task: DownloadBuildArtifacts@0
displayName: 'Download Deb Artifacts'
inputs:
downloadType: specific
itemPattern: '**/*.deb'
downloadPath: '$(System.ArtifactsDirectory)\finished'
condition: and(eq(variables['buildName'], 'DEB'),succeeded())
- task: DownloadBuildArtifacts@0
displayName: 'Download tar.gz Artifacts copy'
inputs:
downloadType: specific
itemPattern: '**/*.tar.gz'
downloadPath: '$(System.ArtifactsDirectory)\finished'
- task: DownloadBuildArtifacts@0
displayName: 'Download rpm Artifacts copy'
inputs:
downloadType: specific
itemPattern: '**/*.rpm'
downloadPath: '$(System.ArtifactsDirectory)\rpm'
condition: and(eq(variables['buildName'], 'RPM'),succeeded())
- task: AzureFileCopy@1
displayName: 'Upload to azure deb and tar.gz'
inputs:
SourcePath: '$(System.ArtifactsDirectory)\finished\release'
azureSubscription: '$(AzureFileCopySubscription)'
Destination: AzureBlob
storage: '$(StorageAccount)'
ContainerName: '$(AzureVersion)'
- task: AzureFileCopy@1
displayName: 'Upload to azure rpm'
inputs:
SourcePath: '$(System.ArtifactsDirectory)\rpm\release'
azureSubscription: '$(AzureFileCopySubscription)'
Destination: AzureBlob
storage: '$(StorageAccount)'
ContainerName: '$(AzureVersion)-unsigned'
condition: and(eq(variables['buildName'], 'RPM'),succeeded())