Skip to content
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

Switch repo to use native AzDO container support #14541

Merged
merged 4 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
587 changes: 289 additions & 298 deletions .vsts-ci.yml

Large diffs are not rendered by default.

17 changes: 1 addition & 16 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ args=
while [[ $# > 0 ]]; do
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
--docker)
export BUILD_IN_DOCKER=1
export DOCKER_IMAGENAME=$2
shift
;;
--noprettyprint)
export DOTNET_CORESDK_NOPRETTYPRINT=1
;;
Expand All @@ -44,14 +39,4 @@ while [[ $# > 0 ]]; do
shift
done

dockerbuild()
{
BUILD_COMMAND=$DIR/run-build.sh $DIR/eng/dockerrun.sh --non-interactive "$@"
}

# Check if we need to build in docker
if [ ! -z "$BUILD_IN_DOCKER" ]; then
dockerbuild $args
else
$DIR/run-build.sh $args
fi
$DIR/run-build.sh $args
228 changes: 155 additions & 73 deletions eng/build.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,153 @@
parameters:
# Agent OS identifier and used as job name
agentOs: ''
- name: agentOs
type: string

# Agent pool
pool: {}
# Job name
- name: jobName
type: string

# Additional variables
variables: {}

# Build strategy - matrix
strategy: {}
# Container to run the build in, if any
- name: container
type: string
default: ''

# Job timeout
timeoutInMinutes: 180

# Publish using pipelines
enablePublishUsingPipelines: true

phases:
- name: timeoutInMinutes
type: number
default: 180

# Build configuration (Debug, Release)
- name: buildConfiguration
type: string
values:
- Debug
- Release

# Build architecture
- name: buildArchitecture
type: string
values:
- arm
- arm64
- x64
- x86

# Linux portable. If true, passes portable switch to build
- name: linuxPortable
type: boolean
default: false

# Runtime Identifier
- name: runtimeIdentifier
type: string
default: ''

# UI lang
- name: dotnetCLIUILanguage
type: string
default: ''

# Additional parameters
- name: additionalBuildParameters
type: string
default: ''

# Run tests
- name: runTests
type: boolean
default: true

# PGO instrumentation jobs
- name: pgoInstrument
type: boolean
default: false

jobs:
- template: /eng/common/templates/job/job.yml
parameters:
# Set up the name of the job.
${{ if parameters.pgoInstrument }}:
name: PGO_${{ parameters.agentOs }}
name: PGO_${{ parameters.agentOs }}_${{ parameters.jobName }}
${{ if not(parameters.pgoInstrument) }}:
name: ${{ parameters.agentOs }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
name: ${{ parameters.agentOs }}_${{ parameters.jobName }}

## Set up the pool/machine info to be used based on the Agent OS
${{ if eq(parameters.agentOs, 'Windows_NT') }}:
enableMicrobuild: true
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: NetCore-Public
demands: ImageOverride -equals build.windows.10.amd64.vs2019.open
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals build.windows.10.amd64.vs2019
${{ if eq(parameters.agentOs, 'Linux') }}:
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: NetCore-Public
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64
container: ${{ parameters.container }}
${{ if eq(parameters.agentOs, 'Darwin') }}:
pool:
vmImage: 'macOS-latest'

timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
enablePublishBuildAssets: true
# Don't use built-in arcade logic for publishing artifacts and test results, as we manually do this and give better names
#enablePublishBuildArtifacts: true
#enablePublishTestResults: true
enablePublishUsingPipelines: ${{parameters.enablePublishUsingPipelines}}
enablePublishUsingPipelines: true
enableTelemetry: true
helixRepo: dotnet/installer
pool: ${{ parameters.pool }}
${{ if ne(parameters.strategy, '') }}:
strategy: ${{ parameters.strategy }}
workspace:
clean: all

# Test parameters
variables:
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
- _PackArg: '-pack'
- ${{ if parameters.runTests }}:
- _TestArg: '-test'
- ${{ else }}:
- _TestArg: ''
- ${{ if ne(parameters.agentOs, 'Windows_NT') }}:
- _PackArg: '--pack'
- ${{ if parameters.runTests }}:
- _TestArg: '--test'
- ${{ else }}:
- _TestArg: ''

- ${{ if parameters.pgoInstrument }}:
- _PgoInstrument: '/p:PgoInstrument=true'
- _PackArg: ''
- ${{ else }}:
- _PgoInstrument: ''
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
- _PackArg: '-pack'
- ${{ if ne(parameters.agentOs, 'Windows_NT') }}:
- _PackArg: '--pack'
- ${{ if parameters.pgoInstrument }}:
- _PgoInstrument: '/p:PgoInstrument=true'
- _PackArg: ''

- _AgentOSName: ${{ parameters.agentOs }}
- _TeamName: Roslyn-Project-System
- _SignType: test
- _BuildArgs: '/p:DotNetSignType=$(_SignType) $(_PgoInstrument)'

- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- group: DotNet-Symbol-Server-PATs
- group: DotNet-HelixApi-Access
- group: DotNet-Blob-Feed
- _DotNetPublishToBlobFeed: true
- _PushToVSFeed: true
- _SignType: real
- _BuildArgs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
/p:DotNetSignType=$(_SignType)
/p:TeamName=$(_TeamName)
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
$(_PgoInstrument)

- ${{ if parameters.linuxPortable }}:
- _LinuxPortable: '--linux-portable'
- ${{ else }}:
- _LinuxPortable: ''

- ${{ if ne(parameters.runtimeIdentifier, '') }}:
- _RuntimeIdentifier: '--runtime-id ${{ parameters.runtimeIdentifier }}'
- ${{ else }}:
- _RuntimeIdentifier: ''

- _AgentOSName: ${{ parameters.agentOs }}
- _TeamName: Roslyn-Project-System
- _SignType: test
- _BuildArgs: '/p:DotNetSignType=$(_SignType) $(_PgoInstrument)'

- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- group: DotNet-HelixApi-Access
- _PushToVSFeed: true
- _SignType: real
- _BuildArgs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
/p:DotNetSignType=$(_SignType)
/p:TeamName=$(_TeamName)
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
$(_PgoInstrument)

steps:
- checkout: self
Expand All @@ -83,14 +164,14 @@ phases:
- script: build.cmd
$(_TestArg) $(_PackArg)
-publish -ci -sign
-Configuration $(_BuildConfig)
-Architecture $(_BuildArchitecture)
-Configuration ${{ parameters.buildConfiguration }}
-Architecture ${{ parameters.buildArchitecture }}
$(_BuildArgs)
$(_AdditionalBuildParameters)
${{ parameters.additionalBuildParameters }}
$(_InternalRuntimeDownloadArgs)
displayName: Build
env:
DOTNET_CLI_UI_LANGUAGE: $(_DOTNET_CLI_UI_LANGUAGE)
DOTNET_CLI_UI_LANGUAGE: ${{ parameters.dotnetCLIUILanguage }}

- ${{ if ne(parameters.agentOs, 'Windows_NT') }}:
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
Expand All @@ -106,13 +187,12 @@ phases:
$(_TestArg) $(_PackArg)
--publish --ci
--noprettyprint
--configuration $(_BuildConfig)
$(_DockerParameter)
--architecture $(_BuildArchitecture)
--configuration ${{ parameters.buildConfiguration }}
--architecture ${{ parameters.buildArchitecture }}
$(_LinuxPortable)
$(_RuntimeIdentifier)
$(_BuildArgs)
$(_AdditionalBuildParameters)
${{ parameters.additionalBuildParameters }}
$(_InternalRuntimeDownloadArgs)
displayName: Build

Expand All @@ -121,41 +201,43 @@ phases:
$(_TestArg)
--pack --publish --ci
--noprettyprint
--configuration $(_BuildConfig)
--architecture $(_BuildArchitecture)
--configuration ${{ parameters.buildConfiguration }}
--architecture ${{ parameters.buildArchitecture }}
$(_RuntimeIdentifier)
$(_BuildArgs)
$(_AdditionalBuildParameters)
${{ parameters.additionalBuildParameters }}
$(_InternalRuntimeDownloadArgs)
displayName: Build

- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.agentOs, 'Windows_NT'), ne(variables['PostBuildSign'], 'true')) }}:
- task: NuGetCommand@2
displayName: Push Visual Studio NuPkgs
inputs:
command: push
packagesToPush: '$(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/NonShipping/VS.*.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'DevDiv - VS package feed'
condition: and(succeeded(), ne(variables['PostBuildSign'], true), eq(variables['_PushToVSFeed'], 'true'), eq(variables['_DotNetPublishToBlobFeed'], 'true'), or(eq(variables['_BuildArchitecture'], 'x64'), eq(variables['_BuildArchitecture'], 'x86')))
# In general, only push VS nupkgs if post-build signing is off, and this is not a PR
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), ne(variables['PostBuildSign'], 'true')) }}:
# In addition, restrict to just Windows x86 or x64 builds (other windows builds do not produce VS redist packages.)
- ${{ if and(eq(parameters.agentOs, 'Windows_NT'), in(parameters.buildArchitecture, 'x64', 'x86')) }}:
- task: NuGetCommand@2
displayName: Push Visual Studio NuPkgs
inputs:
command: push
packagesToPush: '$(Build.SourcesDirectory)/artifacts/packages/${{ parameters.buildConfiguration }}/NonShipping/VS.*.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'DevDiv - VS package feed'

- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testRunner: XUnit
testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml'
testResultsFiles: 'artifacts/TestResults/${{ parameters.buildConfiguration }}/*.xml'
testRunTitle: '$(_AgentOSName)_$(Agent.JobName)'
platform: '$(BuildPlatform)'
configuration: '$(_BuildConfig)'
configuration: '${{ parameters.buildConfiguration }}'
condition: ne(variables['_TestArg'], '')

- task: CopyFiles@2
displayName: Gather Logs
inputs:
SourceFolder: '$(Build.SourcesDirectory)/artifacts'
Contents: |
log/$(_BuildConfig)/**/*
TestResults/$(_BuildConfig)/**/*
log/${{ parameters.buildConfiguration }}/**/*
TestResults/${{ parameters.buildConfiguration }}/**/*
TargetFolder: '$(Build.ArtifactStagingDirectory)'
continueOnError: true
condition: always()
Expand Down
34 changes: 0 additions & 34 deletions eng/docker/alpine.3.15/Dockerfile

This file was deleted.

25 changes: 0 additions & 25 deletions eng/docker/centos/Dockerfile

This file was deleted.

Loading