Skip to content

Commit

Permalink
Merge pull request #479 from Azure/wk/fixPSIssuesWithPipelines
Browse files Browse the repository at this point in the history
Update extractor and publisher scripts
  • Loading branch information
waelkdouh authored Feb 9, 2024
2 parents d5dae4d + 892b479 commit 68e61ad
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
8 changes: 5 additions & 3 deletions tools/azdo_pipelines/run-extractor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ stages:
Write-Information "Downloading extractor..."
$extractorFileName = "extractor.linux-x64"
$extractorFinalFileName = "extractor"
if("$(Agent.OS)" -like "*win*"){
if ("$(Agent.OS)" -like "*win*") {
$extractorFileName = "extractor.win-x64.exe"
$extractorFinalFileName = "extractor.exe"
}
else if("$(Agent.OS)" -like "*mac*" && "$(Agent.OSArchitecture)" -like "*arm*"){
elseif ("$(Agent.OS)" -like "*mac*" -and "$(Agent.OSArchitecture)" -like "*arm*") {
$extractorFileName = "extractor.osx-arm64"
}
$uri = "https://github.com/Azure/apiops/releases/download/$(apiops_release_version)/$extractorFileName"
$destinationFilePath = Join-Path "$(Agent.TempDirectory)" $extractorFinalFileName
Invoke-WebRequest -Uri "$uri" -OutFile "$destinationFilePath"
Expand Down Expand Up @@ -276,4 +278,4 @@ stages:
Write-Information "Execution complete."
pwsh: true
env:
AZURE_DEVOPS_EXT_PAT: "$(System.AccessToken)"
AZURE_DEVOPS_EXT_PAT: "$(System.AccessToken)"
6 changes: 3 additions & 3 deletions tools/azdo_pipelines/run-publisher-with-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ steps:
Write-Information "Downloading publisher..."
$publisherFileName = "publisher.linux-x64"
$publisherFinalFileName = "publisher"
if("$(Agent.OS)" -like "*win*"){
if ("$(Agent.OS)" -like "*win*") {
$publisherFileName = "publisher.win-x64.exe"
$publisherFinalFileName = "publisher.exe"
}
else if("$(Agent.OS)" -like "*mac*" && "$(Agent.OSArchitecture)" -like "*arm*"){
elseif ("$(Agent.OS)" -like "*mac*" -and "$(Agent.OSArchitecture)" -like "*arm*") {
$publisherFileName = "publisher.osx-arm64"
}
Expand Down Expand Up @@ -143,4 +143,4 @@ steps:
${{ if eq( parameters['COMMIT_ID'], 'publish-artifacts-in-last-commit' ) }}:
COMMIT_ID: $(Build.SourceVersion)
${{ if ne( parameters['CONFIGURATION_YAML_PATH'], '' ) }}:
CONFIGURATION_YAML_PATH: ${{ parameters.CONFIGURATION_YAML_PATH }}
CONFIGURATION_YAML_PATH: ${{ parameters.CONFIGURATION_YAML_PATH }}
4 changes: 2 additions & 2 deletions tools/github_workflows/run-extractor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ jobs:
Write-Information "Downloading extractor..."
$extractorFileName = "extractor.linux-x64"
$extractorFinalFileName = "extractor"
if("${{ runner.os }}" -like "*win*"){
if ("${{ runner.os }}" -like "*win*") {
$extractorFileName = "extractor.win-x64.exe"
$extractorFinalFileName = "extractor.exe"
}
else if("${{ runner.os }}" -like "*mac*" && "${{ runner.arch }}" -like "*arm*"){
elseif ("${{ runner.os }}" -like "*mac*" -and "${{ runner.arch }}" -like "*arm*") {
$extractorFileName = "extractor.osx-arm64"
}
Expand Down
4 changes: 2 additions & 2 deletions tools/github_workflows/run-publisher-with-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ jobs:
Write-Information "Downloading publisher..."
$publisherFileName = "publisher.linux-x64"
$publisherFinalFileName = "publisher"
if("${{ runner.os }}" -like "*win*"){
if ("${{ runner.os }}" -like "*win*") {
$publisherFileName = "publisher.win-x64.exe"
$publisherFinalFileName = "publisher.exe"
}
else if("${{ runner.os }}" -like "*mac*" && "${{ runner.arch }}" -like "*arm*"){
elseif ("${{ runner.os }}" -like "*mac*" -and "${{ runner.arch }}" -like "*arm*") {
$publisherFileName = "publisher.osx-arm64"
}
Expand Down

0 comments on commit 68e61ad

Please sign in to comment.