Enabling Azure DevOps YAML builds.
This commit is contained in:
parent
f664f5d478
commit
94c0c96099
11 changed files with 652 additions and 34 deletions
156
.vsts-ci.yml
Normal file
156
.vsts-ci.yml
Normal file
|
@ -0,0 +1,156 @@
|
|||
trigger:
|
||||
- master
|
||||
|
||||
variables:
|
||||
teamName: Roslyn-Project-System
|
||||
|
||||
phases:
|
||||
- template: /eng/build.yml
|
||||
parameters:
|
||||
agentOs: Windows_NT
|
||||
queue:
|
||||
name: Hosted VS2017
|
||||
parallel: 99
|
||||
matrix:
|
||||
Build_Debug_x86:
|
||||
_BuildConfig: Debug
|
||||
_BuildArchitecture: x86
|
||||
_DOTNET_CLI_UI_LANGUAGE: ''
|
||||
_DropSuffix: ''
|
||||
Build_Release_x64:
|
||||
_BuildConfig: Release
|
||||
_BuildArchitecture: x64
|
||||
_DOTNET_CLI_UI_LANGUAGE: ''
|
||||
_DropSuffix: ''
|
||||
Build_ES_Debug_x64:
|
||||
_BuildConfig: Debug
|
||||
_BuildArchitecture: x64
|
||||
_DOTNET_CLI_UI_LANGUAGE: es
|
||||
_DropSuffix: ''
|
||||
Build_DropSuffix_Release_x64:
|
||||
_BuildConfig: Release
|
||||
_BuildArchitecture: x64
|
||||
_DOTNET_CLI_UI_LANGUAGE: ''
|
||||
_DropSuffix: true
|
||||
|
||||
- template: /eng/build.yml
|
||||
parameters:
|
||||
agentOs: Linux
|
||||
queue:
|
||||
name: Hosted Ubuntu 1604
|
||||
parallel: 99
|
||||
matrix:
|
||||
Build_Ubuntu_14_04_Release_x64:
|
||||
_BuildConfig: Release
|
||||
_DockerParameter: '--docker ubuntu.14.04'
|
||||
_LinuxPortable: ''
|
||||
_RuntimeIdentifier: ''
|
||||
_BuildArchitecture: 'x64'
|
||||
_DropSuffix: ''
|
||||
Build_Ubuntu_16_04_Debug_x64:
|
||||
_BuildConfig: Debug
|
||||
_DockerParameter: '--docker ubuntu.16.04'
|
||||
_LinuxPortable: ''
|
||||
_RuntimeIdentifier: ''
|
||||
_BuildArchitecture: 'x64'
|
||||
_DropSuffix: ''
|
||||
Build_Ubuntu_18_04_Debug_x64:
|
||||
_BuildConfig: Debug
|
||||
_DockerParameter: '--docker ubuntu.18.04'
|
||||
_LinuxPortable: '--linux-portable'
|
||||
_RuntimeIdentifier: ''
|
||||
_BuildArchitecture: 'x64'
|
||||
_DropSuffix: ''
|
||||
Build_Fedora_27_Debug_x64:
|
||||
_BuildConfig: Debug
|
||||
_DockerParameter: '--docker fedora.27'
|
||||
_LinuxPortable: '--linux-portable'
|
||||
_RuntimeIdentifier: ''
|
||||
_BuildArchitecture: 'x64'
|
||||
_DropSuffix: ''
|
||||
Build_OpenSUSE_42_3_Debug_x64:
|
||||
_BuildConfig: Debug
|
||||
_DockerParameter: '--docker opensuse.42.3'
|
||||
_LinuxPortable: '--linux-portable'
|
||||
_RuntimeIdentifier: ''
|
||||
_BuildArchitecture: 'x64'
|
||||
_DropSuffix: ''
|
||||
Build_CentOS_7_1_Debug_x64:
|
||||
_BuildConfig: Debug
|
||||
_DockerParameter: '--docker centos'
|
||||
_LinuxPortable: ''
|
||||
_RuntimeIdentifier: ''
|
||||
_BuildArchitecture: 'x64'
|
||||
_DropSuffix: ''
|
||||
Build_Debian_8_2_Debug_x64:
|
||||
_BuildConfig: Debug
|
||||
_DockerParameter: '--docker debian'
|
||||
_LinuxPortable: ''
|
||||
_RuntimeIdentifier: ''
|
||||
_BuildArchitecture: 'x64'
|
||||
_DropSuffix: ''
|
||||
Build_Rhel_7_2_Release_x64:
|
||||
_BuildConfig: Release
|
||||
_DockerParameter: '--docker rhel'
|
||||
_LinuxPortable: ''
|
||||
_RuntimeIdentifier: ''
|
||||
_BuildArchitecture: 'x64'
|
||||
_DropSuffix: ''
|
||||
Build_Rhel_6_Debug_x64:
|
||||
_BuildConfig: Debug
|
||||
_DockerParameter: '--docker rhel.6'
|
||||
_LinuxPortable: ''
|
||||
_RuntimeIdentifier: '--runtime-id rhel.6-x64'
|
||||
_BuildArchitecture: 'x64'
|
||||
_DropSuffix: ''
|
||||
Build_Arm_Debug:
|
||||
_BuildConfig: Debug
|
||||
_DockerParameter: ''
|
||||
_LinuxPortable: '--linux-portable'
|
||||
_RuntimeIdentifier: ''
|
||||
_BuildArchitecture: 'arm'
|
||||
_DropSuffix: ''
|
||||
Build_Arm64_Debug:
|
||||
_BuildConfig: Debug
|
||||
_DockerParameter: ''
|
||||
_LinuxPortable: '--linux-portable'
|
||||
_RuntimeIdentifier: ''
|
||||
_BuildArchitecture: 'arm64'
|
||||
_DropSuffix: ''
|
||||
Build_Linux_musl_Debug_x64:
|
||||
_BuildConfig: Debug
|
||||
_DockerParameter: '--docker alpine.3.6'
|
||||
_LinuxPortable: ''
|
||||
_RuntimeIdentifier: '--runtime-id linux-musl-x64'
|
||||
_BuildArchitecture: 'x64'
|
||||
_DropSuffix: ''
|
||||
Build_LinuxPortable_Release_x64:
|
||||
_BuildConfig: Release
|
||||
_DockerParameter: ''
|
||||
_LinuxPortable: '--linux-portable'
|
||||
_RuntimeIdentifier: ''
|
||||
_BuildArchitecture: 'x64'
|
||||
_DropSuffix: ''
|
||||
Build_LinuxPortable_NoSuffix_Release_x64:
|
||||
_BuildConfig: Release
|
||||
_DockerParameter: ''
|
||||
_LinuxPortable: '--linux-portable'
|
||||
_RuntimeIdentifier: ''
|
||||
_BuildArchitecture: 'x64'
|
||||
_DropSuffix: true
|
||||
Build_Arm_NoSuffix_Release:
|
||||
_BuildConfig: Release
|
||||
_DockerParameter: ''
|
||||
_LinuxPortable: '--linux-portable'
|
||||
_RuntimeIdentifier: ''
|
||||
_BuildArchitecture: 'arm'
|
||||
_DropSuffix: true
|
||||
|
||||
- template: /eng/build.yml
|
||||
parameters:
|
||||
agentOs: Darwin
|
||||
queue:
|
||||
name: Hosted macOS
|
||||
matrix:
|
||||
Build_Release:
|
||||
_BuildConfig: Release
|
82
eng/build.yml
Normal file
82
eng/build.yml
Normal file
|
@ -0,0 +1,82 @@
|
|||
parameters:
|
||||
agentOs: ''
|
||||
queue: {}
|
||||
variables: {}
|
||||
|
||||
phases:
|
||||
- template: /eng/common/templates/phases/base.yml
|
||||
parameters:
|
||||
name: ${{ parameters.agentOs }}
|
||||
enableTelemetry: true
|
||||
publicBuildReasons: PullRequest
|
||||
queue: ${{ parameters.queue }}
|
||||
variables:
|
||||
${{ insert }}: ${{ parameters.variables }}
|
||||
_AgentOSName: ${{ parameters.agentOs }}
|
||||
_HelixType: build/product
|
||||
_HelixBuildConfig: $(_BuildConfig)
|
||||
BuildConfig: $(_BuildConfig)
|
||||
BuildArchitecture: $(_BuildArchitecture)
|
||||
_HelixSource: pr/dotnet/core-sdk/$(Build.SourceBranch)
|
||||
DockerParameter: $(_DockerParameter)
|
||||
LinuxPortable: $(_LinuxPortable)
|
||||
RuntimeId: $(_RuntimeIdentifier)
|
||||
|
||||
steps:
|
||||
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
|
||||
- script: build.cmd
|
||||
-Configuration $(BuildConfig)
|
||||
-Architecture $(BuildArchitecture)
|
||||
displayName: Build
|
||||
env:
|
||||
DOTNET_CLI_UI_LANGUAGE: $(_DOTNET_CLI_UI_LANGUAGE)
|
||||
DropSuffix: $(_DropSuffix)
|
||||
|
||||
- ${{ if eq(parameters.agentOs, 'Linux') }}:
|
||||
- script: ./build.sh
|
||||
--skip-prereqs
|
||||
--configuration $(BuildConfig)
|
||||
$(DockerParameter)
|
||||
--architecture $(BuildArchitecture)
|
||||
$(LinuxPortable)
|
||||
$(RuntimeId)
|
||||
displayName: Build
|
||||
env:
|
||||
DropSuffix: $(_DropSuffix)
|
||||
|
||||
- ${{ if eq(parameters.agentOs, 'Darwin') }}:
|
||||
- script: ./build.sh
|
||||
--skip-prereqs
|
||||
--configuration $(BuildConfig)
|
||||
displayName: Build
|
||||
|
||||
- task: PublishTestResults@1
|
||||
displayName: Publish Test Results
|
||||
inputs:
|
||||
testRunner: VSTest
|
||||
testResultsFiles: '**/*.trx'
|
||||
testRunTitle: 'Unit Test Results'
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(_BuildConfig)'
|
||||
condition: and(succeededOrFailed(), ne(variables['PB_SkipTests'], 'true'))
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: Gather Logs
|
||||
inputs:
|
||||
SourceFolder: '$(Build.SourcesDirectory)'
|
||||
Contents: |
|
||||
msbuild.log
|
||||
msbuild.mainbuild.binlog
|
||||
msbuild.generatepropsfile.binlog
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
||||
continueOnError: true
|
||||
condition: always()
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish Logs to VSTS
|
||||
inputs:
|
||||
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
||||
ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)'
|
||||
publishLocation: Container
|
||||
continueOnError: true
|
||||
condition: always()
|
107
eng/common/templates/phases/base.yml
Normal file
107
eng/common/templates/phases/base.yml
Normal file
|
@ -0,0 +1,107 @@
|
|||
parameters:
|
||||
# Optional: Clean sources before building
|
||||
clean: true
|
||||
|
||||
# Optional: Git fetch depth
|
||||
fetchDepth: ''
|
||||
|
||||
# Optional: name of the phase (not specifying phase name may cause name collisions)
|
||||
name: ''
|
||||
|
||||
# Required: A defined YAML queue
|
||||
queue: {}
|
||||
|
||||
# Required: build steps
|
||||
steps: []
|
||||
|
||||
# Optional: variables
|
||||
variables: {}
|
||||
|
||||
## Telemetry variables
|
||||
|
||||
# Optional: enable sending telemetry
|
||||
# if 'true', these "variables" must be specified in the variables object or as part of the queue matrix
|
||||
# _HelixBuildConfig - differentiate between Debug, Release, other
|
||||
# _HelixSource - Example: build/product
|
||||
# _HelixType - Example: official/dotnet/arcade/$(Build.SourceBranch)
|
||||
enableTelemetry: false
|
||||
|
||||
# Optional: Enable installing Microbuild plugin
|
||||
# if 'true', these "variables" must be specified in the variables object or as part of the queue matrix
|
||||
# _TeamName - the name of your team
|
||||
# _SignType - 'test' or 'real'
|
||||
enableMicrobuild: false
|
||||
|
||||
# Internal resources (telemetry, microbuild) can only be accessed from non-public projects,
|
||||
# and some (Microbuild) should only be applied to non-PR cases for internal builds.
|
||||
|
||||
phases:
|
||||
- phase: ${{ parameters.name }}
|
||||
|
||||
queue: ${{ parameters.queue }}
|
||||
|
||||
${{ if ne(parameters.variables, '') }}:
|
||||
variables: ${{ parameters.variables }}
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: ${{ parameters.clean }}
|
||||
${{ if ne(parameters.fetchDepth, '') }}:
|
||||
fetchDepth: ${{ parameters.fetchDepth }}
|
||||
|
||||
- ${{ if eq(parameters.enableTelemetry, 'true') }}:
|
||||
- template: /eng/common/templates/steps/telemetry-start.yml
|
||||
parameters:
|
||||
buildConfig: $(_HelixBuildConfig)
|
||||
helixSource: $(_HelixSource)
|
||||
helixType: $(_HelixType)
|
||||
|
||||
- ${{ if eq(parameters.enableMicrobuild, 'true') }}:
|
||||
# Internal only resource, and Microbuild signing shouldn't be applied to PRs.
|
||||
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- task: MicroBuildSigningPlugin@1
|
||||
displayName: Install MicroBuild plugin
|
||||
inputs:
|
||||
signType: $(_SignType)
|
||||
zipSources: false
|
||||
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
|
||||
|
||||
env:
|
||||
TeamName: $(_TeamName)
|
||||
continueOnError: false
|
||||
condition: and(succeeded(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT'))
|
||||
|
||||
# Run provided build steps
|
||||
- ${{ parameters.steps }}
|
||||
|
||||
- ${{ if eq(parameters.enableMicrobuild, 'true') }}:
|
||||
# Internal only resources
|
||||
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
|
||||
- task: MicroBuildCleanup@1
|
||||
displayName: Execute Microbuild cleanup tasks
|
||||
condition: and(always(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT'))
|
||||
env:
|
||||
TeamName: $(_TeamName)
|
||||
|
||||
- ${{ if eq(parameters.enableTelemetry, 'true') }}:
|
||||
- template: /eng/common/templates/steps/telemetry-end.yml
|
||||
parameters:
|
||||
helixSource: $(_HelixSource)
|
||||
helixType: $(_HelixType)
|
||||
|
||||
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- task: CopyFiles@2
|
||||
displayName: Gather Asset Manifests
|
||||
inputs:
|
||||
SourceFolder: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/AssetManifest'
|
||||
TargetFolder: '$(Build.StagingDirectory)/AssetManifests'
|
||||
continueOnError: false
|
||||
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Push Asset Manifests
|
||||
inputs:
|
||||
PathtoPublish: '$(Build.StagingDirectory)/AssetManifests'
|
||||
PublishLocation: Container
|
||||
ArtifactName: AssetManifests
|
||||
continueOnError: false
|
||||
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
|
26
eng/common/templates/phases/publish-build-asset.yml
Normal file
26
eng/common/templates/phases/publish-build-asset.yml
Normal file
|
@ -0,0 +1,26 @@
|
|||
parameters:
|
||||
dependsOn: ''
|
||||
queue: {}
|
||||
phases:
|
||||
- phase: Push to B.A.R.
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
queue: ${{ parameters.queue }}
|
||||
steps:
|
||||
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download artifact
|
||||
inputs:
|
||||
artifactName: AssetManifests
|
||||
downloadPath: '$(Build.StagingDirectory)/Download'
|
||||
condition: succeeded()
|
||||
- task: AzureKeyVault@1
|
||||
inputs:
|
||||
azureSubscription: 'DotNet-Engineering-Services_KeyVault'
|
||||
KeyVaultName: EngKeyVault
|
||||
SecretsFilter: 'MaestroAccessToken'
|
||||
condition: succeeded()
|
||||
- script: eng\common\publishbuildassets.cmd
|
||||
/p:ManifestZipFilePath='$(Build.StagingDirectory)/Download/AssetManifests'
|
||||
/p:BuildAssetRegistryToken=$(MaestroAccessToken)
|
||||
/p:MaestroApiEndpoint=https://maestro-int.westus2.cloudapp.azure.com
|
||||
displayName: Push Build Assets
|
12
eng/common/templates/steps/build-reason.yml
Normal file
12
eng/common/templates/steps/build-reason.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
# build-reason.yml
|
||||
# Description: runs steps if build.reason condition is valid. conditions is a string of valid build reasons
|
||||
# to include steps (',' separated).
|
||||
parameters:
|
||||
conditions: ''
|
||||
steps: []
|
||||
|
||||
steps:
|
||||
- ${{ if and( not(startsWith(parameters.conditions, 'not')), contains(parameters.conditions, variables['build.reason'])) }}:
|
||||
- ${{ parameters.steps }}
|
||||
- ${{ if and( startsWith(parameters.conditions, 'not'), not(contains(parameters.conditions, variables['build.reason']))) }}:
|
||||
- ${{ parameters.steps }}
|
7
eng/common/templates/steps/run-on-unix.yml
Normal file
7
eng/common/templates/steps/run-on-unix.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
parameters:
|
||||
agentOs: ''
|
||||
steps: []
|
||||
|
||||
steps:
|
||||
- ${{ if ne(parameters.agentOs, 'Windows_NT') }}:
|
||||
- ${{ parameters.steps }}
|
7
eng/common/templates/steps/run-on-windows.yml
Normal file
7
eng/common/templates/steps/run-on-windows.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
parameters:
|
||||
agentOs: ''
|
||||
steps: []
|
||||
|
||||
steps:
|
||||
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
|
||||
- ${{ parameters.steps }}
|
33
eng/common/templates/steps/run-script-ifequalelse.yml
Normal file
33
eng/common/templates/steps/run-script-ifequalelse.yml
Normal file
|
@ -0,0 +1,33 @@
|
|||
parameters:
|
||||
# if parameter1 equals parameter 2, run 'ifScript' command, else run 'elsescript' command
|
||||
parameter1: ''
|
||||
parameter2: ''
|
||||
ifScript: ''
|
||||
elseScript: ''
|
||||
|
||||
# name of script step
|
||||
name: Script
|
||||
|
||||
# display name of script step
|
||||
displayName: If-Equal-Else Script
|
||||
|
||||
# environment
|
||||
env: {}
|
||||
|
||||
# conditional expression for step execution
|
||||
condition: ''
|
||||
|
||||
steps:
|
||||
- ${{ if and(ne(parameters.ifScript, ''), eq(parameters.parameter1, parameters.parameter2)) }}:
|
||||
- script: ${{ parameters.ifScript }}
|
||||
name: ${{ parameters.name }}
|
||||
displayName: ${{ parameters.displayName }}
|
||||
env: ${{ parameters.env }}
|
||||
condition: ${{ parameters.condition }}
|
||||
|
||||
- ${{ if and(ne(parameters.elseScript, ''), ne(parameters.parameter1, parameters.parameter2)) }}:
|
||||
- script: ${{ parameters.elseScript }}
|
||||
name: ${{ parameters.name }}
|
||||
displayName: ${{ parameters.displayName }}
|
||||
env: ${{ parameters.env }}
|
||||
condition: ${{ parameters.condition }}
|
67
eng/common/templates/steps/telemetry-end.yml
Normal file
67
eng/common/templates/steps/telemetry-end.yml
Normal file
|
@ -0,0 +1,67 @@
|
|||
parameters:
|
||||
helixSource: 'undefined_defaulted_in_telemetry.yml'
|
||||
helixType: 'undefined_defaulted_in_telemetry.yml'
|
||||
|
||||
steps:
|
||||
- bash: |
|
||||
if [ "$AGENT_JOBSTATUS" = "Succeeded" ] || [ "$AGENT_JOBSTATUS" = "PartiallySucceeded" ]; then
|
||||
errorCount=0
|
||||
else
|
||||
errorCount=1
|
||||
fi
|
||||
warningCount=0
|
||||
|
||||
# create a temporary file for curl output
|
||||
res=`mktemp`
|
||||
|
||||
curlResult=`
|
||||
curl --verbose --output $res --write-out "%{http_code}"\
|
||||
-H 'Content-Type: application/json' \
|
||||
-H "X-Helix-Job-Token: $Helix_JobToken" \
|
||||
-H 'Content-Length: 0' \
|
||||
-X POST -G "https://helix.dot.net/api/2018-03-14/telemetry/job/build/$Helix_WorkItemId/finish" \
|
||||
--data-urlencode "errorCount=$errorCount" \
|
||||
--data-urlencode "warningCount=$warningCount"`
|
||||
curlStatus=$?
|
||||
|
||||
if [ $curlStatus -eq 0 ]; then
|
||||
if [ $curlResult -gt 299 ] || [ $curlResult -lt 200 ]; then
|
||||
curlStatus=$curlResult
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $curlStatus -ne 0 ]; then
|
||||
echo "Failed to Send Build Finish information"
|
||||
vstsLogOutput="vso[task.logissue type=error;sourcepath=templates/steps/telemetry-end.yml;code=1;]Failed to Send Build Finish information: $curlStatus"
|
||||
echo "##$vstsLogOutput"
|
||||
exit 1
|
||||
fi
|
||||
displayName: Send Unix Build End Telemetry
|
||||
env:
|
||||
# defined via VSTS variables in start-job.sh
|
||||
Helix_JobToken: $(Helix_JobToken)
|
||||
Helix_WorkItemId: $(Helix_WorkItemId)
|
||||
condition: and(always(), ne(variables['Agent.Os'], 'Windows_NT'))
|
||||
- powershell: |
|
||||
if (($env:Agent_JobStatus -eq 'Succeeded') -or ($env:Agent_JobStatus -eq 'PartiallySucceeded')) {
|
||||
$ErrorCount = 0
|
||||
} else {
|
||||
$ErrorCount = 1
|
||||
}
|
||||
$WarningCount = 0
|
||||
|
||||
try {
|
||||
Invoke-RestMethod -Uri "https://helix.dot.net/api/2018-03-14/telemetry/job/build/$env:Helix_WorkItemId/finish?errorCount=$ErrorCount&warningCount=$WarningCount" -Method Post -ContentType "application/json" -Body "" `
|
||||
-Headers @{ 'X-Helix-Job-Token'=$env:Helix_JobToken }
|
||||
}
|
||||
catch {
|
||||
Write-Error $_
|
||||
Write-Error $_.Exception
|
||||
exit 1
|
||||
}
|
||||
displayName: Send Windows Build End Telemetry
|
||||
env:
|
||||
# defined via VSTS variables in start-job.ps1
|
||||
Helix_JobToken: $(Helix_JobToken)
|
||||
Helix_WorkItemId: $(Helix_WorkItemId)
|
||||
condition: and(always(),eq(variables['Agent.Os'], 'Windows_NT'))
|
154
eng/common/templates/steps/telemetry-start.yml
Normal file
154
eng/common/templates/steps/telemetry-start.yml
Normal file
|
@ -0,0 +1,154 @@
|
|||
parameters:
|
||||
helixSource: 'undefined_defaulted_in_telemetry.yml'
|
||||
helixType: 'undefined_defaulted_in_telemetry.yml'
|
||||
buildConfig: ''
|
||||
|
||||
steps:
|
||||
- ${{ if not(eq(variables['System.TeamProject'], 'public')) }}:
|
||||
- task: AzureKeyVault@1
|
||||
inputs:
|
||||
azureSubscription: 'HelixProd_KeyVault'
|
||||
KeyVaultName: HelixProdKV
|
||||
SecretsFilter: 'HelixApiAccessToken'
|
||||
condition: always()
|
||||
- bash: |
|
||||
# create a temporary file
|
||||
jobInfo=`mktemp`
|
||||
|
||||
# write job info content to temporary file
|
||||
cat > $jobInfo <<JobListStuff
|
||||
{
|
||||
"QueueId": "$QueueId",
|
||||
"Source": "$Source",
|
||||
"Type": "$Type",
|
||||
"Build": "$Build",
|
||||
"Attempt": "$Attempt",
|
||||
"Properties": {
|
||||
"operatingSystem": "$OperatingSystem",
|
||||
"configuration": "$Configuration"
|
||||
}
|
||||
}
|
||||
JobListStuff
|
||||
|
||||
# create a temporary file for curl output
|
||||
res=`mktemp`
|
||||
|
||||
accessTokenParameter=''
|
||||
if [[ ! "$HelixApiAccessToken" == "" ]]; then
|
||||
accessTokenParameter="?access_token=$HelixApiAccessToken"
|
||||
fi
|
||||
|
||||
curlResult=`
|
||||
cat $jobInfo |\
|
||||
curl --verbose --output $res --write-out "%{http_code}" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-X POST "https://helix.dot.net/api/2018-03-14/telemetry/job$accessTokenParameter" -d @-`
|
||||
curlStatus=$?
|
||||
|
||||
if [ $curlStatus -eq 0 ]; then
|
||||
if [ $curlResult -gt 299 ] || [ $curlResult -lt 200 ]; then
|
||||
curlStatus=$curlResult
|
||||
fi
|
||||
fi
|
||||
|
||||
curlResult=`cat $res`
|
||||
|
||||
# validate status of curl command
|
||||
if [ $curlStatus -ne 0 ]; then
|
||||
echo "Failed To Send Job Start information"
|
||||
# We have to append the ## vso prefix or vso will pick up the command when it dumps the inline script into the shell
|
||||
vstsLogOutput="vso[task.logissue type=error;sourcepath=telemetry/start-job.sh;code=1;]Failed to Send Job Start information: $curlStatus"
|
||||
echo "##$vstsLogOutput"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set the Helix_JobToken variable
|
||||
export Helix_JobToken=`echo $curlResult | xargs echo` # Strip Quotes
|
||||
echo "##vso[task.setvariable variable=Helix_JobToken;issecret=true;]$Helix_JobToken"
|
||||
displayName: Send Unix Job Start Telemetry
|
||||
env:
|
||||
HelixApiAccessToken: $(HelixApiAccessToken)
|
||||
Source: ${{ parameters.helixSource }}
|
||||
Type: ${{ parameters.helixType }}
|
||||
Build: $(Build.BuildNumber)
|
||||
QueueId: $(Agent.Os)
|
||||
Attempt: 1
|
||||
OperatingSystem: $(Agent.Os)
|
||||
Configuration: ${{ parameters.buildConfig }}
|
||||
condition: and(always(), ne(variables['Agent.Os'], 'Windows_NT'))
|
||||
- bash: |
|
||||
res=`mktemp`
|
||||
curlResult=`
|
||||
curl --verbose --output $res --write-out "%{http_code}"\
|
||||
-H 'Content-Type: application/json' \
|
||||
-H "X-Helix-Job-Token: $Helix_JobToken" \
|
||||
-H 'Content-Length: 0' \
|
||||
-X POST -G "https://helix.dot.net/api/2018-03-14/telemetry/job/build" \
|
||||
--data-urlencode "buildUri=$BuildUri"`
|
||||
curlStatus=$?
|
||||
|
||||
if [ $curlStatus -eq 0 ]; then
|
||||
if [ $curlResult -gt 299 ] || [ $curlResult -lt 200 ]; then
|
||||
curlStatus=$curlResult
|
||||
fi
|
||||
fi
|
||||
|
||||
curlResult=`cat $res`
|
||||
|
||||
# validate status of curl command
|
||||
if [ $curlStatus -ne 0 ]; then
|
||||
echo "Failed to Send Build Start information"
|
||||
vstsLogOutput="vso[task.logissue type=error;sourcepath=telemetry/build/start.sh;code=1;]Failed to Send Build Start information: $curlStatus"
|
||||
echo "##$vstsLogOutput"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export Helix_WorkItemId=`echo $curlResult | xargs echo` # Strip Quotes
|
||||
echo "##vso[task.setvariable variable=Helix_WorkItemId]$Helix_WorkItemId"
|
||||
displayName: Send Unix Build Start Telemetry
|
||||
env:
|
||||
BuildUri: $(System.TaskDefinitionsUri)$(System.TeamProject)/_build/index?buildId=$(Build.BuildId)&_a=summary
|
||||
Helix_JobToken: $(Helix_JobToken)
|
||||
condition: and(always(), ne(variables['Agent.Os'], 'Windows_NT'))
|
||||
|
||||
- powershell: |
|
||||
$jobInfo = [pscustomobject]@{
|
||||
QueueId=$env:QueueId;
|
||||
Source=$env:Source;
|
||||
Type=$env:Type;
|
||||
Build=$env:Build;
|
||||
Attempt=$env:Attempt;
|
||||
Properties=[pscustomobject]@{ operatingSystem=$env:OperatingSystem; configuration=$env:Configuration };
|
||||
}
|
||||
|
||||
$jobInfoJson = $jobInfo | ConvertTo-Json
|
||||
|
||||
if ($env:HelixApiAccessToken) {
|
||||
$accessTokenParameter="?access_token=$($env:HelixApiAccessToken)"
|
||||
}
|
||||
Write-Host "Job Info: $jobInfoJson"
|
||||
$jobToken = Invoke-RestMethod -Uri "https://helix.dot.net/api/2018-03-14/telemetry/job$($accessTokenParameter)" -Method Post -ContentType "application/json" -Body $jobInfoJson
|
||||
$env:Helix_JobToken = $jobToken
|
||||
Write-Host "##vso[task.setvariable variable=Helix_JobToken;issecret=true;]$env:Helix_JobToken"
|
||||
displayName: Send Windows Job Start Telemetry
|
||||
env:
|
||||
HelixApiAccessToken: $(HelixApiAccessToken)
|
||||
Source: ${{ parameters.helixSource }}
|
||||
Type: ${{ parameters.helixType }}
|
||||
Build: $(Build.BuildNumber)
|
||||
QueueId: $(Agent.Os)
|
||||
Attempt: 1
|
||||
OperatingSystem: $(Agent.Os)
|
||||
Configuration: ${{ parameters.buildConfig }}
|
||||
condition: and(always(), eq(variables['Agent.Os'], 'Windows_NT'))
|
||||
- powershell: |
|
||||
$workItemId = Invoke-RestMethod -Uri "https://helix.dot.net/api/2018-03-14/telemetry/job/build?buildUri=$([Net.WebUtility]::UrlEncode($env:BuildUri))" -Method Post -ContentType "application/json" -Body "" `
|
||||
-Headers @{ 'X-Helix-Job-Token'=$env:Helix_JobToken }
|
||||
|
||||
$env:Helix_WorkItemId = $workItemId
|
||||
Write-Host "##vso[task.setvariable variable=Helix_WorkItemId]$env:Helix_WorkItemId"
|
||||
displayName: Send Windows Build Start Telemetry
|
||||
env:
|
||||
BuildUri: $(System.TaskDefinitionsUri)$(System.TeamProject)/_build/index?buildId=$(Build.BuildId)&_a=summary
|
||||
Helix_JobToken: $(Helix_JobToken)
|
||||
condition: and(always(), eq(variables['Agent.Os'], 'Windows_NT'))
|
|
@ -4,40 +4,7 @@
|
|||
#
|
||||
|
||||
# Dockerfile that creates a container suitable to build dotnet-cli
|
||||
FROM centos:7.1.1503
|
||||
|
||||
# Swap the "fakesystemd" package with the real "systemd" package, because fakesystemd conflicts with openssl-devel.
|
||||
# The CentOS Docker image uses fakesystemd instead of systemd to reduce disk space.
|
||||
RUN yum -q -y swap -- remove fakesystemd -- install systemd systemd-libs
|
||||
|
||||
RUN yum -q -y install deltarpm
|
||||
RUN yum -q -y install epel-release
|
||||
# RUN yum -y update
|
||||
|
||||
# This could become a "microsoft/coreclr" image, since it just installs the dependencies for CoreCLR (and stdlib)
|
||||
# Install CoreCLR and CoreFx dependencies
|
||||
RUN yum -q -y install unzip libunwind gettext libcurl-devel openssl-devel zlib libicu-devel
|
||||
|
||||
# RUN apt-get update && \
|
||||
# apt-get -qqy install unzip curl libicu-dev libunwind8 gettext libssl-dev libcurl3-gnutls zlib1g liblttng-ust-dev lldb-3.6-dev lldb-3.6
|
||||
|
||||
# Install Build Prereqs
|
||||
# CMake 3.3.2 from GhettoForge; LLVM 3.6.2 built from source ourselves;
|
||||
RUN yum install -y http://mirror.symnds.com/distributions/gf/el/7/plus/x86_64/cmake-3.3.2-1.gf.el7.x86_64.rpm \
|
||||
https://matell.blob.core.windows.net/rpms/clang-3.6.2-1.el7.centos.x86_64.rpm \
|
||||
https://matell.blob.core.windows.net/rpms/clang-libs-3.6.2-1.el7.centos.x86_64.rpm \
|
||||
https://matell.blob.core.windows.net/rpms/lldb-3.6.2-1.el7.centos.x86_64.rpm \
|
||||
https://matell.blob.core.windows.net/rpms/lldb-devel-3.6.2-1.el7.centos.x86_64.rpm \
|
||||
https://matell.blob.core.windows.net/rpms/llvm-3.6.2-1.el7.centos.x86_64.rpm \
|
||||
https://matell.blob.core.windows.net/rpms/llvm-libs-3.6.2-1.el7.centos.x86_64.rpm \
|
||||
which \
|
||||
make
|
||||
|
||||
RUN yum -q -y install tar git
|
||||
|
||||
# Use clang as c++ compiler
|
||||
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
|
||||
RUN update-alternatives --set c++ /usr/bin/clang++
|
||||
FROM microsoft/dotnet-buildtools-prereqs:centos-7-b46d863-20180719033416
|
||||
|
||||
RUN yum -q -y install sudo
|
||||
|
||||
|
|
Loading…
Reference in a new issue