From b0aa6c678ceb1c069f3092bc2ca0d0970b824bb5 Mon Sep 17 00:00:00 2001 From: aminya Date: Tue, 14 Jul 2020 22:43:31 -0500 Subject: [PATCH] using AGENT_OS directly --- script/vsts/platforms/templates/bootstrap.yml | 3 +-- script/vsts/platforms/templates/build.yml | 5 ++--- script/vsts/platforms/templates/test.yml | 11 ++++------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/script/vsts/platforms/templates/bootstrap.yml b/script/vsts/platforms/templates/bootstrap.yml index e483ec4ea..6e10e8165 100644 --- a/script/vsts/platforms/templates/bootstrap.yml +++ b/script/vsts/platforms/templates/bootstrap.yml @@ -1,6 +1,6 @@ steps: - pwsh: | - if (($env:OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) { + if (($env:AGENT_OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) { node 'script\vsts\windows-run.js' 'script\bootstrap.cmd' } else { @@ -9,7 +9,6 @@ steps: displayName: Bootstrap build environment env: GITHUB_TOKEN: $(GITHUB_TOKEN) - OS: $(Agent.OS) CI: true CI_PROVIDER: VSTS ${{ if eq(variables['Agent.OS'], 'Windows_NT') }}: diff --git a/script/vsts/platforms/templates/build.yml b/script/vsts/platforms/templates/build.yml index b683e675a..5d7563ad1 100644 --- a/script/vsts/platforms/templates/build.yml +++ b/script/vsts/platforms/templates/build.yml @@ -1,6 +1,6 @@ steps: - pwsh: | - if ($env:OS -eq "Windows_NT") { + if ($env:AGENT_OS -eq "Windows_NT") { mkdir -f -p $env:SQUIRREL_TEMP if ($env:IS_RELEASE_BRANCH -eq "true") { $CreateWindowsInstallaer="--create-windows-installer" @@ -13,14 +13,13 @@ steps: } else { $CodeSign="" } - if (($env:OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) { + if (($env:AGENT_OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) { node 'script\vsts\windows-run.js' 'script\build.cmd' --no-bootstrap --compress-artifacts $env:args $CodeSign $CreateWindowsInstallaer } else { script/build --no-bootstrap --compress-artifacts $env:args $CodeSign $CreateWindowsInstallaer } displayName: Build Atom env: - OS: $(Agent.OS) GITHUB_TOKEN: $(GITHUB_TOKEN) IS_RELEASE_BRANCH: $(IsReleaseBranch) IS_SIGNED_ZIP_BRANCH: $(IsSignedZipBranch) diff --git a/script/vsts/platforms/templates/test.yml b/script/vsts/platforms/templates/test.yml index ddef43c9e..2e08f3091 100644 --- a/script/vsts/platforms/templates/test.yml +++ b/script/vsts/platforms/templates/test.yml @@ -1,15 +1,14 @@ steps: - pwsh: | - if ($env:OS -eq "Darwin") { + if ($env:AGENT_OS -eq "Darwin") { osascript -e 'tell application "System Events" to keystroke "x"' # clear screen saver caffeinate -s script/test # Run with caffeinate to prevent screen saver - } elseif (($env:OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) { + } elseif (($env:AGENT_OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) { node 'script\vsts\windows-run.js' 'script\test.cmd' } else { script/test } env: - OS: $(Agent.OS) ${{ if eq(variables['Agent.OS'], 'Windows_NT') }}: BUILD_ARCH: $(buildArch) ${{ if eq(variables['Agent.OS'], 'Linux') }}: @@ -25,13 +24,12 @@ steps: # Test results - pwsh: | - if (($env:OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) { + if (($env:AGENT_OS -eq "Windows_NT") -and ($env:BUILD_ARCH -eq "x86")) { node 'script\vsts\windows-run.js' 'script\postprocess-junit-results.cmd' --search-folder "$env:TEST_JUNIT_XML_ROOT" --test-results-files "**/*.xml" } else { script/postprocess-junit-results --search-folder "$env:TEST_JUNIT_XML_ROOT" --test-results-files "**/*.xml" } env: - OS: $(Agent.OS) ${{ if eq(variables['Agent.OS'], 'Windows_NT') }}: BUILD_ARCH: $(buildArch) TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)/junit @@ -51,13 +49,12 @@ steps: # Crash Reports - pwsh: | mkdir -f -p $env:ARTIFACT_STAGING_DIR/crash-reports - if (($env:OS -eq "Windows_NT") -and (Test-Path "$env:TEMP/Atom Crashes")) { + if (($env:AGENT_OS -eq "Windows_NT") -and (Test-Path "$env:TEMP/Atom Crashes")) { cp "$env:TEMP/Atom Crashes/*.dmp" $env:ARTIFACT_STAGING_DIR/crash-reports } else { cp $env:HOME/Library/Logs/DiagnosticReports/*.crash $env:ARTIFACT_STAGING_DIR/crash-reports } env: - OS: $(Agent.OS) ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory) displayName: Stage Crash Reports condition: failed()