2018-12-05 23:47:54 +01:00
|
|
|
parameters:
|
|
|
|
buildName: ''
|
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()
|
|
|
|
pool: Hosted Ubuntu 1604
|
2018-12-05 23:47:54 +01:00
|
|
|
variables:
|
|
|
|
build: ${{ parameters.buildName }}
|
2018-11-05 19:35:53 +01:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- powershell: |
|
2018-12-05 23:47:54 +01:00
|
|
|
tools/releaseBuild/setReleaseTag.ps1 -ReleaseTag $(ReleaseTagVar) -Variable "ReleaseTagVar"
|
2018-11-05 19:35:53 +01:00
|
|
|
displayName: 'Run setReleaseTag.ps1'
|
|
|
|
|
|
|
|
- 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.*'
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
Import-Module $(Build.SourcesDirectory)/build.psm1 -Force
|
|
|
|
New-NugetConfigFile -NugetFeedUrl $(AzDevOpsFeed) -UserName $(AzDevOpsFeedUserName) -ClearTextPAT $(AzDevOpsFeedPAT) -FeedName AzDevOpsFeed -Destination $(Build.SourcesDirectory)/src/Modules
|
2018-11-05 19:35:53 +01:00
|
|
|
|
2018-12-05 23:47:54 +01:00
|
|
|
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')
|
2018-11-05 19:35:53 +01:00
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
import-module ./build.psm1
|
|
|
|
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: |
|
2018-12-05 23:47:54 +01:00
|
|
|
tools/releaseBuild/vstsbuild.ps1 -ReleaseTag $(ReleaseTagVar) -Name '$(build)'
|
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 }}
|
|
|
|
displayName: Upload ${{ parameters.buildName }}
|
|
|
|
dependsOn: build_${{ parameters.buildName }}
|
2018-11-05 19:35:53 +01:00
|
|
|
condition: succeeded()
|
|
|
|
pool: Package ES CodeHub Lab E
|
2018-12-05 23:47:54 +01:00
|
|
|
variables:
|
|
|
|
buildName: ${{ parameters.buildName }}
|
2018-11-05 19:35:53 +01:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- powershell: |
|
2018-12-05 23:47:54 +01:00
|
|
|
tools/releaseBuild/setReleaseTag.ps1 -ReleaseTag $(ReleaseTagVar) -Variable "ReleaseTagVar"
|
2018-11-05 19:35:53 +01:00
|
|
|
displayName: 'Set ReleaseTag'
|
|
|
|
|
|
|
|
- powershell: |
|
2018-12-05 23:47:54 +01:00
|
|
|
$azureVersion = $env:ReleaseTagVar.ToLowerInvariant() -replace '\.', '-'
|
2018-11-05 19:35:53 +01:00
|
|
|
$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'
|
2018-12-05 23:47:54 +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'
|
|
|
|
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
displayName: 'Download rpm Artifacts copy'
|
|
|
|
inputs:
|
|
|
|
downloadType: specific
|
|
|
|
itemPattern: '**/*.rpm'
|
|
|
|
downloadPath: '$(System.ArtifactsDirectory)\rpm'
|
2018-12-05 23:47:54 +01:00
|
|
|
condition: and(eq(variables['buildName'], 'RPM'),succeeded())
|
2018-11-05 19:35:53 +01:00
|
|
|
|
|
|
|
- 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'
|
2018-12-05 23:47:54 +01:00
|
|
|
condition: and(eq(variables['buildName'], 'RPM'),succeeded())
|