From 109e6bd0094e06070c9a08c26cfe914ee4c806cf Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Wed, 9 Dec 2020 11:15:10 +0300 Subject: [PATCH] check condition --- azure-pipelines/get-tool-versions.yml | 1 + .../templates/get-tool-versions-steps.yml | 46 +++++++++---------- .../parsers/base-parser.psm1 | 3 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/azure-pipelines/get-tool-versions.yml b/azure-pipelines/get-tool-versions.yml index 8c38d6c..b4cf600 100644 --- a/azure-pipelines/get-tool-versions.yml +++ b/azure-pipelines/get-tool-versions.yml @@ -32,6 +32,7 @@ stages: - stage: Trigger_Builds dependsOn: Get_New_Versions + condition: and(succeeded(), ne(stageDependencies.Get_New_Versions.Get_Tool_Versions.outputs['Get_versions.TOOL_VERSIONS'], '') 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 e01a238..b783b34 100644 --- a/azure-pipelines/templates/get-tool-versions-steps.yml +++ b/azure-pipelines/templates/get-tool-versions-steps.yml @@ -8,18 +8,18 @@ steps: arguments: | -ToolName "$(TOOL_NAME)" -- task: PowerShell@2 - displayName: 'Cancel build' - condition: and(succeeded(), eq(variables['Get_versions.TOOL_VERSIONS'], '')) - inputs: - TargetType: inline - script: | - Import-Module "./azure-devops/azure-devops-api.ps1" - $azureDevOpsApi = Get-AzureDevOpsApi -TeamFoundationCollectionUri $(System.TeamFoundationCollectionUri) ` - -ProjectName $(System.TeamProject) ` - -AccessToken $(System.AccessToken) +# - task: PowerShell@2 +# displayName: 'Cancel build' +# condition: and(succeeded(), eq(variables['Get_versions.TOOL_VERSIONS'], '')) +# inputs: +# TargetType: inline +# script: | +# 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 +# $AzureDevOpsApi.UpdateBuildStatus($(Build.BuildId), 'Cancelling') | Out-Null - task: PowerShell@2 displayName: 'Set env variable' @@ -30,15 +30,15 @@ steps: $PipelineUrl = "$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)" Write-Output "##vso[task.setvariable variable=PIPELINE_URL]$PipelineUrl" -- 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 "$(PIPELINE_URL)" ` - -ImageUrl "$(IMAGE_URL)" +# - 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 "$(PIPELINE_URL)" ` +# -ImageUrl "$(IMAGE_URL)" diff --git a/get-new-tool-versions/parsers/base-parser.psm1 b/get-new-tool-versions/parsers/base-parser.psm1 index 706f879..6118fd9 100644 --- a/get-new-tool-versions/parsers/base-parser.psm1 +++ b/get-new-tool-versions/parsers/base-parser.psm1 @@ -4,7 +4,7 @@ class BaseVersionsParser { [SemVer[]] GetAvailableVersions() { $allVersionsRaw = $this.ParseAllAvailableVersions() - $allVersions = $allVersionsRaw | ForEach-Object { Write-Host $_; $this.FormatVersion($_) } + $allVersions = $allVersionsRaw | ForEach-Object { $this.FormatVersion($_) } $filteredVersions = $allVersions | Where-Object { $this.ShouldIncludeVersion($_) } return $filteredVersions } @@ -26,7 +26,6 @@ class BaseVersionsParser { } hidden [string] BuildGitHubFileUrl($OrganizationName, $RepositoryName, $BranchName, $FilePath) { - # https://raw.githubusercontent.com/actions/node-versions/main/versions-manifest.json return "https://raw.githubusercontent.com/${OrganizationName}/${RepositoryName}/${BranchName}/${FilePath}" } } \ No newline at end of file