2019-01-22 20:21:02 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
- job: ComponentRegistrationJob
|
|
|
|
displayName: Component Registration
|
|
|
|
condition: succeeded()
|
|
|
|
|
|
|
|
pool:
|
|
|
|
name: PowerShell
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
tools/releaseBuild/setReleaseTag.ps1 -ReleaseTag $(ReleaseTagVar) -Variable "ReleaseTagVar"
|
|
|
|
displayName: 'Set ReleaseTag Variable'
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
$version = '$(ReleaseTagVar)'.Substring(1)
|
|
|
|
$vstsCommandString = "vso[task.setvariable variable=Version]$version"
|
|
|
|
Write-Host "sending " + $vstsCommandString
|
|
|
|
Write-Host "##$vstsCommandString"
|
|
|
|
displayName: 'Set Version Variable'
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
docker container prune --force
|
|
|
|
docker container ls --all --format '{{ json .ID }}' | ConvertFrom-Json | ForEach-Object {docker container rm --force --volumes $_}
|
|
|
|
displayName: 'Remove all containers'
|
|
|
|
# Cleanup is not critical it passes every time it runs
|
|
|
|
continueOnError: true
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
docker image ls --format '{{ json .}}'|ConvertFrom-Json| ForEach-Object {
|
|
|
|
if($_.tag -eq '<none>')
|
|
|
|
{
|
|
|
|
$formatString = 'yyyy-MM-dd HH:mm:ss zz00'
|
|
|
|
$createdAtString = $_.CreatedAt.substring(0,$_.CreatedAt.Length -4)
|
|
|
|
$createdAt = [DateTime]::ParseExact($createdAtString, $formatString,[System.Globalization.CultureInfo]::InvariantCulture)
|
|
|
|
if($createdAt -lt (Get-Date).adddays(-1))
|
|
|
|
{
|
|
|
|
docker image rm $_.ID
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exit 0
|
|
|
|
displayName: 'Remove old images'
|
|
|
|
# Cleanup is not critical it passes every time it runs
|
|
|
|
continueOnError: true
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
Write-verbose "--docker info---" -verbose
|
|
|
|
docker info
|
|
|
|
Write-verbose "--docker image ls---" -verbose
|
|
|
|
docker image ls
|
|
|
|
Write-verbose "--docker container ls --all---" -verbose
|
|
|
|
docker container ls --all
|
|
|
|
displayName: 'Capture Docker Info'
|
|
|
|
# Diagnostics is not critical it passes every time it runs
|
|
|
|
continueOnError: true
|
|
|
|
|
2019-01-30 23:10:52 +01:00
|
|
|
- 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 '
|
|
|
|
|
2019-01-22 20:21:02 +01:00
|
|
|
- powershell: |
|
|
|
|
./tools/releaseBuild/vstsbuild.ps1 -ReleaseTag $(ReleaseTagVar) -Name win-x64-component-registration
|
|
|
|
displayName: 'Build Windows Universal - Component Registration'
|
|
|
|
|
|
|
|
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
|
|
|
displayName: 'Component Detection'
|
|
|
|
inputs:
|
|
|
|
sourceScanPath: '$(componentregistration)'
|
|
|
|
snapshotForceEnabled: true
|