diff --git a/README.md b/README.md index a14e5c61d..464397442 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ |---|---| |master|[![Build Status](https://azfunc.visualstudio.com/Azure%20Functions/_apis/build/status/azure-functions-core-tools?branchName=master)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=11&branchName=master) |dev|[![Build Status](https://azfunc.visualstudio.com/Azure%20Functions/_apis/build/status/azure-functions-core-tools?branchName=dev)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=11&branchName=dev) -|v1.x|[![Build status](https://ci.appveyor.com/api/projects/status/max86pwo54y44j36/branch/v1.x?svg=true)](https://ci.appveyor.com/project/appsvc/azure-functions-cli/branch/v1.x)| +|v1.x|[![Build status](https://azfunc.visualstudio.com/Azure%20Functions/_apis/build/status/azure-functions-core-tools?branchName=v1.x)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=11&branchName=v1.x)| # Azure Functions Core Tools diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 3c815d61d..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: "{build}" - -branches: - only: - - v1.x - -pull_requests: - do_not_increment_build_number: true -image: Visual Studio 2017 - -clone_folder: c:\azure-functions-cli - -build_script: -- "SET PATH=C:\\Python36;C:\\Python36\\Scripts;%PATH%" -- ps: | - .\build.ps1 - if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } - -artifacts: -- path: artifacts\Azure.Functions.*.zip - name: Release -- path: artifacts\Azure.Functions.*.sha2 - name: Release \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c877f6e3b..c19fef330 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,8 +16,8 @@ pool: variables: devops_buildNumber: $[counter(format(''), 1500)] - APPVEYOR_REPO_BRANCH: $[coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranchName'])] - APPVEYOR_REPO_COMMIT: $(Build.SourceVersion) + DEVOPS_REPO_BRANCH: $[coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranchName'])] + DEVOPS_REPO_COMMIT: $(Build.SourceVersion) steps: - pwsh: | @@ -32,7 +32,7 @@ steps: env: BuildSourceBranchName: $(Build.SourceBranchName) - pwsh: | - Write-Host "Target branch: '$(APPVEYOR_REPO_BRANCH)'" + Write-Host "Target branch: '$(DEVOPS_REPO_BRANCH)'" displayName: Set up environment variables - task: NodeTool@0 inputs: diff --git a/build.ps1 b/build.ps1 index 7e66d3687..a0037f459 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,24 +1,24 @@ -if ($env:APPVEYOR_REPO_BRANCH -eq "disabled") { +if ($env:DEVOPS_REPO_BRANCH -eq "disabled") { Set-Location ".\src\Azure.Functions.Cli" - $result = Invoke-Expression -Command "NuGet list Microsoft.Azure.Functions.JavaWorker -Source https://ci.appveyor.com/NuGet/azure-functions-java-worker-fejnnsvmrkqg -PreRelease" + $result = & { NuGet list Microsoft.Azure.Functions.JavaWorker -Source https://ci.appveyor.com/NuGet/azure-functions-java-worker-fejnnsvmrkqg -PreRelease } $javaWorkerVersion = $result.Split()[1] Write-host "Adding Microsoft.Azure.Functions.JavaWorker $javaWorkerVersion to project" -ForegroundColor Green - Invoke-Expression -Command "dotnet add package Microsoft.Azure.Functions.JavaWorker -v $javaWorkerVersion -s https://ci.appveyor.com/NuGet/azure-functions-java-worker-fejnnsvmrkqg" + & { dotnet add package Microsoft.Azure.Functions.JavaWorker -v $javaWorkerVersion -s https://ci.appveyor.com/NuGet/azure-functions-java-worker-fejnnsvmrkqg } - $result = Invoke-Expression -Command "NuGet list Microsoft.Azure.Functions.PowerShellWorker -Source https://ci.appveyor.com/nuget/azure-functions-powershell-wor-0842fakagqy6 -PreRelease" + $result = & { NuGet list Microsoft.Azure.Functions.PowerShellWorker -Source https://ci.appveyor.com/nuget/azure-functions-powershell-wor-0842fakagqy6 -PreRelease } $powerShellWorkerVersion = $result.Split()[1] Write-host "Adding Microsoft.Azure.Functions.PowerShellWorker $powerShellWorkerVersion to project" -ForegroundColor Green - Invoke-Expression -Command "dotnet add package Microsoft.Azure.Functions.PowerShellWorker -v $powerShellWorkerVersion -s https://ci.appveyor.com/nuget/azure-functions-powershell-wor-0842fakagqy6" + & { dotnet add package Microsoft.Azure.Functions.PowerShellWorker -v $powerShellWorkerVersion -s https://ci.appveyor.com/nuget/azure-functions-powershell-wor-0842fakagqy6 } - $result = Invoke-Expression -Command "NuGet list Microsoft.Azure.Functions.NodeJsWorker -Source https://ci.appveyor.com/nuget/azure-functions-nodejs-worker-0fcvx371y52p -PreRelease" + $result = & { NuGet list Microsoft.Azure.Functions.NodeJsWorker -Source https://ci.appveyor.com/nuget/azure-functions-nodejs-worker-0fcvx371y52p -PreRelease } $nodeJsWorkerVersion = $result.Split()[1] Write-host "Adding Microsoft.Azure.Functions.NodeJsWorker $nodeJsWorkerVersion to project" -ForegroundColor Green - Invoke-Expression -Command "dotnet add package Microsoft.Azure.Functions.NodeJsWorker -v $nodeJsWorkerVersion -s https://ci.appveyor.com/nuget/azure-functions-nodejs-worker-0fcvx371y52p" + & { dotnet add package Microsoft.Azure.Functions.NodeJsWorker -v $nodeJsWorkerVersion -s https://ci.appveyor.com/nuget/azure-functions-nodejs-worker-0fcvx371y52p } - $result = Invoke-Expression -Command "NuGet list Microsoft.Azure.WebJobs.Script.WebHost -Source https://ci.appveyor.com/NuGet/azure-webjobs-sdk-script-g6rygw981l9t -PreRelease" + $result = & { NuGet list Microsoft.Azure.WebJobs.Script.WebHost -Source https://ci.appveyor.com/NuGet/azure-webjobs-sdk-script-g6rygw981l9t -PreRelease } $WebHostVersion = $result.Split()[1] Write-host "Adding Microsoft.Azure.WebJobs.Script.WebHost $WebHostVersion to project" -ForegroundColor Green - Invoke-Expression -Command "dotnet add package Microsoft.Azure.WebJobs.Script.WebHost -v $WebHostVersion -s https://ci.appveyor.com/NuGet/azure-webjobs-sdk-script-g6rygw981l9t" + & { dotnet add package Microsoft.Azure.WebJobs.Script.WebHost -v $WebHostVersion -s https://ci.appveyor.com/NuGet/azure-webjobs-sdk-script-g6rygw981l9t } Set-Location "..\..\build" } else { @@ -32,18 +32,18 @@ $simulateReleaseBuild = $null if (-not([bool]::TryParse($env:IsReleaseBuild, [ref] $isReleaseBuild) -and [bool]::TryParse($env:SimulateReleaseBuild, [ref] $simulateReleaseBuild))) { - throw "IsReleaseBuild and GenerateSBOM can only be set to true or false." + throw "IsReleaseBuild and SimulateReleaseBuild can only be set to true or false." } if ($isReleaseBuild -or $simulateReleaseBuild) { - $buildCommand = "dotnet run --ci --generateSBOM" + $buildCommand = { dotnet run --ci --generateSBOM } } else { - $buildCommand = "dotnet run --ci" + $buildCommand = { dotnet run --ci } } Write-Host "Running $buildCommand" -Invoke-Expression -Command $buildCommand +& $buildCommand if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } \ No newline at end of file diff --git a/build/Settings.cs b/build/Settings.cs index c2e535961..3cc97ec66 100644 --- a/build/Settings.cs +++ b/build/Settings.cs @@ -94,9 +94,9 @@ private static string config(string @default = null, [CallerMemberName] string k public static readonly string TelemetryKeyToReplace = "00000000-0000-0000-0000-000000000000"; - public static string BuildNumber => config(null, "devops_buildNumber") ?? config("9999", "APPVEYOR_BUILD_NUMBER"); + public static string BuildNumber => config("9999", "devops_buildNumber"); - public static string CommitId => config(null, "Build.SourceVersion") ?? config("N/A", "APPVEYOR_REPO_COMMIT"); + public static string CommitId => config("N/A", "Build.SourceVersion"); public static string TelemetryInstrumentationKey => config(null, "TELEMETRY_INSTRUMENTATION_KEY");