You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.6 KiB
YAML
49 lines
1.6 KiB
YAML
steps:
|
|
- task: PowerShell@2
|
|
displayName: Check Versions
|
|
condition: and(succeeded(), eq(variables.ToolVersions, ''))
|
|
inputs:
|
|
TargetType: inline
|
|
script: |
|
|
Write-Host "No new versions were found"
|
|
Import-Module "./azure-devops/azure-devops-api.ps1"
|
|
|
|
$azureDevOpsApi = Get-AzureDevOpsApi -TeamFoundationCollectionUri $(System.TeamFoundationCollectionUri) `
|
|
-ProjectName $(System.TeamProject) `
|
|
-AccessToken $(System.AccessToken)
|
|
|
|
$AzureDevOpsApi.UpdateBuildStatus($(Build.BuildId), 'Cancelling') | Out-Null
|
|
Start-Sleep -Seconds 60
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Set PIPELINE_URL variable'
|
|
inputs:
|
|
TargetType: inline
|
|
script: |
|
|
$ToolName = "$(TOOL_NAME)"
|
|
if ($ToolName -in @("Python", "Xamarin")) {
|
|
$PipelineUrl = " "
|
|
} else {
|
|
$PipelineUrl = "$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)"
|
|
}
|
|
Write-Host "##vso[task.setvariable variable=PIPELINE_URL]$PipelineUrl"
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Change build name'
|
|
inputs:
|
|
TargetType: inline
|
|
script: |
|
|
$newBuildName = "[FOUND] $(Build.BuildNumber)"
|
|
Write-Host "##vso[build.updatebuildnumber]$newBuildName"
|
|
|
|
- task: PowerShell@2
|
|
displayName: 'Send Slack notification'
|
|
inputs:
|
|
targetType: filePath
|
|
filePath: './get-new-tool-versions/send-slack-notification.ps1'
|
|
arguments: |
|
|
-Url "$(SLACK_CHANNEL_URL)" `
|
|
-ToolName "$(TOOL_NAME)" `
|
|
-ToolVersion "$(ToolVersions)" `
|
|
-PipelineUrl "$(PIPELINE_URL)" `
|
|
-ImageUrl "$(IMAGE_URL)" |