-
-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure Pipelines build system not recognized with non-Windows jobs #2432
Comments
Wonder, is that an error in Azure Pipelines or per design? Checking docs at https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=vsts
Normally it's not available on the system but set by the process invoker on each task // Set the TF_BUILD env variable.
_proc.StartInfo.Environment["TF_BUILD"] = "True"; Looking at the docker bits it looks like they're just copying the host variables but not setting the extra "TF_BUILD=True" So likely docker process is getting the variable, but not the container itself. @gitfool maybe worth raising an issue on agent repo to ask. |
@devlead Done and already confirmed as a bug on their side. Re the second problem, since the _environment.GetEnvironmentVariable("AGENT_NAME") == "Hosted Agent" to: _environment.GetEnvironmentVariable("AGENT_NAME").StartsWith("Hosted") Either that or switching to or also checking for the |
Isn't this from your build log?
Looks like |
Yes, for the Docker job, but the other logs use different hosts; currently the Linux host is |
I just noticed another problem. The TFBuildAgentInfo.MachineName is not set - a single |
I see, well yes then startswith makes sense probably
https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=vsts |
Okay, I'll submit a PR with those two changes... |
@gitfool the mac build you can likely fix by adding a .NET installer task into yaml, example of such yaml variables:
DOTNET_SDK_VERSION: '2.1.502'
jobs:
- job: MacOS
displayName: Build on MacOS
pool:
vmImage: 'macOS 10.13'
steps:
- task: DotNetCoreInstaller@0
displayName: 'Use .NET Core SDK $(DOTNET_SDK_VERSION)'
inputs:
version: '$(DOTNET_SDK_VERSION)'
- bash: ./build.sh
displayName: 'Execute Cake Bootstrapper'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testRunner: xUnit
testResultsFiles: '**/test_result.xml'
mergeTestResults: true
- job: Windows
displayName: Build on Windows
pool:
vmImage: 'VS2017-Win2016'
steps:
- task: DotNetCoreInstaller@0
displayName: 'Use .NET Core SDK $(DOTNET_SDK_VERSION)'
inputs:
version: '$(DOTNET_SDK_VERSION)'
- powershell: ./build.ps1
displayName: 'Execute Cake PowerShell Bootstrapper'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testRunner: XUnit
testResultsFiles: '**/test_result.xml'
mergeTestResults: true
- job: Linux
displayName: Build on Linux
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: DotNetCoreInstaller@0
displayName: 'Use .NET Core SDK $(DOTNET_SDK_VERSION)'
inputs:
version: '$(DOTNET_SDK_VERSION)'
- bash: ./build.sh
displayName: 'Execute Cake Bash Bootstrapper'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testRunner: XUnit
testResultsFiles: '**/test_result.xml'
mergeTestResults: true
- job: Docker
displayName: Build Docker Image
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: Docker@1
displayName: 'Build image' |
@devlead thanks for the tip; it works on Mac again! FTR, it only started failing when I switched to |
See the logs for all jobs in Cake.Dungeon/#20190107.3:
There are a couple of problems; one is that
TF_BUILD
is expected in TFBuildProvider.cs#L46 but is missing in the Docker job environment variables, and the other is thatAGENT_NAME
is always defined but not as expected in TFBuildProvider.cs#L82.(The Mac job is currently broken for other reasons I haven't looked into yet.)
The text was updated successfully, but these errors were encountered: