From 0d478268bb9db81f8a970a0b474823c7666a8b99 Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Wed, 16 Dec 2020 11:40:43 +0300 Subject: [PATCH] fix comments --- azure-pipelines/get-tool-versions.yml | 2 +- .../templates/get-tool-versions-steps.yml | 23 ++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/azure-pipelines/get-tool-versions.yml b/azure-pipelines/get-tool-versions.yml index bc9421b..68a2700 100644 --- a/azure-pipelines/get-tool-versions.yml +++ b/azure-pipelines/get-tool-versions.yml @@ -51,7 +51,7 @@ stages: - stage: Trigger_Builds dependsOn: Check_New_Versions - condition: and(succeeded(), eq(variables['WORKFLOW_FILE_NAME'], '')) + condition: and(succeeded(), ne(variables['WORKFLOW_FILE_NAME'], '')) jobs: - deployment: Run_Builds pool: diff --git a/azure-pipelines/templates/get-tool-versions-steps.yml b/azure-pipelines/templates/get-tool-versions-steps.yml index 8e436fe..17d0a7d 100644 --- a/azure-pipelines/templates/get-tool-versions-steps.yml +++ b/azure-pipelines/templates/get-tool-versions-steps.yml @@ -10,18 +10,35 @@ steps: - task: PowerShell@2 displayName: 'Set PIPELINE_URL variable' - condition: and(succeeded(), ne(variables['TOOL_NAME'], 'Python')) inputs: TargetType: inline script: | - $PipelineUrl = "$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)" + $ToolName = "$(ToolName)" + if ($ToolName -eq "Python") { + $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' - #condition: and(succeeded(), ne(variables['Get_versions.TOOL_VERSIONS'], '')) + condition: and(succeeded(), ne(variables['Get_versions.TOOL_VERSIONS'], '')) inputs: TargetType: inline script: | $newBuildName = "[FOUND] $(Build.BuildNumber)" Write-Host "##vso[build.updatebuildnumber]$newBuildName" + +- task: PowerShell@2 + displayName: 'Send Slack notification' + condition: and(succeeded(), ne(variables['Get_versions.TOOL_VERSIONS'], '')) + inputs: + targetType: filePath + filePath: './get-new-tool-versions/send-slack-notification.ps1' + arguments: | + -Url "$(SLACK_CHANNEL_URL)" ` + -ToolName "$(TOOL_NAME)" ` + -ToolVersion "$(Get_versions.TOOL_VERSIONS)" ` + -PipelineUrl "${{ variables.PIPELINE_URL }}" ` + -ImageUrl "$(IMAGE_URL)" \ No newline at end of file