From: Santiago Fernandez Madero Date: Thu, 7 Nov 2019 07:07:26 +0000 (-0800) Subject: Update azure pipelines to account for paths in consolidated repo (dotnet/corefx#42418) X-Git-Tag: submit/tizen/20210909.063632~11031^2~66 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7699e7ef6fd1179a0c78f723f9dbb94e867cf41c;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Update azure pipelines to account for paths in consolidated repo (dotnet/corefx#42418) Commit migrated from https://github.com/dotnet/corefx/commit/94a60d5238f654ab22f162ad3d6dac01adcdaeb8 --- diff --git a/eng/pipelines/libraries/.azure-ci.yml b/eng/pipelines/libraries/.azure-ci.yml index 1191632..626b424 100644 --- a/eng/pipelines/libraries/.azure-ci.yml +++ b/eng/pipelines/libraries/.azure-ci.yml @@ -7,10 +7,11 @@ trigger: branches: include: - master - - release/3.* + - release/3.* # TODO: (Consolidation) Remove when consolidated paths: exclude: - - Documentation/* + - Documentation/* # TODO: (Consolidation) Remove when consolidated + - docs/* - CODE-OF-CONDUCT.md - CONTRIBUTING.md - LICENSE.TXT @@ -18,15 +19,20 @@ trigger: - README.md - SECURITY.md - THIRD-PARTY-NOTICES.TXT + - src/installer/* + - src/coreclr/* + - eng/pipelines/coreclr/* + - eng/pipelines/installer/* pr: branches: include: - master - - release/3.* + - release/3.* # TODO: (Consolidation) Remove when consolidated paths: exclude: - - Documentation/* + - Documentation/* # TODO: (Consolidation) Remove when consolidated + - docs/* - CODE-OF-CONDUCT.md - CONTRIBUTING.md - LICENSE.TXT @@ -34,6 +40,10 @@ pr: - README.md - SECURITY.md - THIRD-PARTY-NOTICES.TXT + - src/installer/* + - src/coreclr/* + - eng/pipelines/coreclr/* + - eng/pipelines/installer/* resources: containers: @@ -59,6 +69,13 @@ resources: image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-a50a721-20191023143845 variables: + - ${{ if contains(variables['Build.DefinitionName'], 'runtime') }}: # TODO: (Consolidation) remove this condition + - template: variables.yml + + # TODO: (Consolidation) remove this conditional block + - ${{ if not(contains(variables['Build.DefinitionName'], 'runtime')) }}: + - template: /eng/pipelines/variables.yml + - ${{ if and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }}: - group: DotNet-Blob-Feed - group: corefx-sdl-validation @@ -73,32 +90,32 @@ variables: stages: # Windows legs - - template: /eng/pipelines/windows.yml + - template: ${{ variables['pipelinesPath'] }}/windows.yml parameters: isOfficialBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }} fullMatrix: ${{ notIn(variables['Build.Reason'], 'PullRequest') }} # Linux legs - - template: /eng/pipelines/linux.yml + - template: ${{ variables['pipelinesPath'] }}/linux.yml parameters: isOfficialBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }} fullMatrix: ${{ notIn(variables['Build.Reason'], 'PullRequest') }} # MacOS legs - - template: /eng/pipelines/macos.yml + - template: ${{ variables['pipelinesPath'] }}/macos.yml parameters: isOfficialBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }} fullMatrix: ${{ notIn(variables['Build.Reason'], 'PullRequest') }} # FreeBSD leg is only for official builds - # - template: /eng/pipelines/freebsd.yml + # - template: ${{ variables['pipelinesPath'] }}/freebsd.yml # parameters: # isOfficialBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }} # fullMatrix: ${{ notIn(variables['Build.Reason'], 'PullRequest') }} # Publish and validation steps. Only run in official builds - ${{ if and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }}: - - template: /eng/pipelines/pre-publish.yml + - template: ${{ variables['pipelinesPath'] }}/pre-publish.yml parameters: dependsOn: - WindowsStage diff --git a/eng/pipelines/libraries/corefx-base.yml b/eng/pipelines/libraries/corefx-base.yml index 3080cb5..44a3413 100644 --- a/eng/pipelines/libraries/corefx-base.yml +++ b/eng/pipelines/libraries/corefx-base.yml @@ -32,10 +32,10 @@ parameters: # Required: submitToHelix -> Boolean -> Value to know if it should submit tests payloads to helix. # Optional: buildScriptPrefix -> String -> string to append to Unix build script. - # buildScriptPrefix: 'HOME=/home/ ' -> 'HOME=/home/ ./build.sh ...' + # buildScriptPrefix: 'HOME=/home/ ' -> 'HOME=/home/ ./$(buildScriptName).sh ...' # Optional: buildExtraArguments -> String -> string to append at the end of the build arguments - # buildExtraArguments: /p:RuntimeOS=win10 -> 'build.cmd ... /p:RuntimeOS=win10' + # buildExtraArguments: /p:RuntimeOS=win10 -> '$(buildScriptName).cmd ... /p:RuntimeOS=win10' # Optional: customBuildSteps -> Array -> list of steps to run instead of the common build steps. # customBuildSteps: @@ -52,7 +52,7 @@ parameters: jobs: - ${{ each job in parameters.jobs }}: - - template: ../common/templates/job/job.yml + - template: /eng/common/templates/job/job.yml parameters: variables: @@ -96,12 +96,12 @@ jobs: # Windows variables - ${{ if eq(parameters.targetOS, 'Windows_NT') }}: - - _buildScript: build.cmd + - _buildScript: $(buildScriptFileName).cmd - _msbuildCommand: powershell -ExecutionPolicy ByPass -NoProfile eng\common\msbuild.ps1 -warnaserror:0 -ci # Non-Windows variables - ${{ if ne(parameters.targetOS, 'Windows_NT') }}: - - _buildScript: ${{ job.buildScriptPrefix }}./build.sh + - _buildScript: ${{ job.buildScriptPrefix }}./$(buildScriptFileName).sh - _msbuildCommand: ${{ job.buildScriptPrefix }}./eng/common/msbuild.sh --warnaserror false --ci - ${{ if eq(parameters.isOfficialBuild, 'true') }}: - _commonArguments: $(_args) -stripSymbols @@ -159,7 +159,7 @@ jobs: - ${{ if eq(job.submitToHelix, 'true') }}: - ${{ if eq(parameters.isOfficialBuild, 'true') }}: - - script: $(_msbuildCommand) src/publishTestAssets.proj + - script: $(_msbuildCommand) $(sourcesRoot)/publishTestAssets.proj /p:FilesToPublishPattern=$(Build.SourcesDirectory)/artifacts/helix/**/*.zip /p:AccountKey=$(dotnetfeed-storage-access-key-1) /p:ExpectedFeedUrl=$(_dotnetFeedUrl) @@ -186,26 +186,50 @@ jobs: artifactType: container condition: and(succeeded(), eq(variables['_publishTests'], 'true')) - - template: /eng/pipelines/helix.yml - parameters: - # send tests to helix only on public builds, official scheduled builds or manual official builds. - condition: eq(${{ parameters.isOfficialBuild }}, False) - targetOS: ${{ parameters.targetOS }} - archGroup: $(_architecture) - configuration: $(_BuildConfig) - helixQueues: $(_helixQueues) - msbuildScript: $(_msbuildCommand) - framework: $(_framework) - testScope: ${{ coalesce(parameters.testScope, 'innerloop') }} # if parameters.testScope is empty use 'innerloop' - - ${{ if eq(parameters.isOfficialBuild, 'true') }}: - officialBuildId: $(Build.BuildNumber) - helixToken: $(HelixApiAccessToken) - - ${{ if eq(parameters.isOfficialBuild, 'false') }}: - # TODO: SET Creator to the PR owner whenever Azure DevOps supports a good way to retrieve it. - creator: dotnet-bot - helixToken: '' + - ${{ if contains(variables['Build.DefinitionName'], 'runtime') }}: # TODO: (Consolidation) remove. + - template: /eng/pipelines/libraries/helix.yml + parameters: + # send tests to helix only on public builds, official scheduled builds or manual official builds. + condition: eq(${{ parameters.isOfficialBuild }}, False) + targetOS: ${{ parameters.targetOS }} + archGroup: $(_architecture) + configuration: $(_BuildConfig) + helixQueues: $(_helixQueues) + msbuildScript: $(_msbuildCommand) + framework: $(_framework) + testScope: ${{ coalesce(parameters.testScope, 'innerloop') }} # if parameters.testScope is empty use 'innerloop' + + ${{ if eq(parameters.isOfficialBuild, 'true') }}: + officialBuildId: $(Build.BuildNumber) + helixToken: $(HelixApiAccessToken) + + ${{ if eq(parameters.isOfficialBuild, 'false') }}: + # TODO: SET Creator to the PR owner whenever Azure DevOps supports a good way to retrieve it. + creator: dotnet-bot + helixToken: '' + + # TODO: (Consolidation) remove this if block when consolidated + - ${{ if not(contains(variables['Build.DefinitionName'], 'runtime')) }}: + - template: /eng/pipelines/helix.yml + parameters: + # send tests to helix only on public builds, official scheduled builds or manual official builds. + condition: eq(${{ parameters.isOfficialBuild }}, False) + targetOS: ${{ parameters.targetOS }} + archGroup: $(_architecture) + configuration: $(_BuildConfig) + helixQueues: $(_helixQueues) + msbuildScript: $(_msbuildCommand) + framework: $(_framework) + testScope: ${{ coalesce(parameters.testScope, 'innerloop') }} # if parameters.testScope is empty use 'innerloop' + + ${{ if eq(parameters.isOfficialBuild, 'true') }}: + officialBuildId: $(Build.BuildNumber) + helixToken: $(HelixApiAccessToken) + + ${{ if eq(parameters.isOfficialBuild, 'false') }}: + # TODO: SET Creator to the PR owner whenever Azure DevOps supports a good way to retrieve it. + creator: dotnet-bot + helixToken: '' - ${{ if eq(parameters.isOfficialBuild, 'true') }}: - task: PublishBuildArtifacts@1 diff --git a/eng/pipelines/libraries/helix.yml b/eng/pipelines/libraries/helix.yml index 419df57..8b20f44 100644 --- a/eng/pipelines/libraries/helix.yml +++ b/eng/pipelines/libraries/helix.yml @@ -13,7 +13,7 @@ parameters: steps: - script: ${{ parameters.msbuildScript }} - src/sendtohelix.proj + $(sourcesRoot)/sendtohelix.proj /t:test /p:ArchGroup=${{ parameters.archGroup }} /p:ConfigurationGroup=${{ parameters.configuration }} diff --git a/eng/pipelines/libraries/outerloop.yml b/eng/pipelines/libraries/outerloop.yml index 6c49eb9..3359fd1 100644 --- a/eng/pipelines/libraries/outerloop.yml +++ b/eng/pipelines/libraries/outerloop.yml @@ -28,10 +28,13 @@ resources: - container: ubuntu_1604_arm_cross_container image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-14.04-23cacb0-20191023143847 +variables: + - template: variables.yml + stages: # Windows outerloop legs - ${{ if or(endsWith(variables['Build.DefinitionName'], 'windows'), endsWith(variables['Build.DefinitionName'], 'outerloop')) }}: - - template: /eng/pipelines/windows.yml + - template: windows.yml parameters: isOfficialBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }} fullMatrix: ${{ notIn(variables['Build.Reason'], 'PullRequest') }} @@ -39,7 +42,7 @@ stages: # Linux outerloop legs - ${{ if or(endsWith(variables['Build.DefinitionName'], 'linux'), endsWith(variables['Build.DefinitionName'], 'outerloop')) }}: - - template: /eng/pipelines/linux.yml + - template: linux.yml parameters: isOfficialBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }} fullMatrix: ${{ notIn(variables['Build.Reason'], 'PullRequest') }} @@ -47,7 +50,7 @@ stages: # MacOS outerloop legs - ${{ if or(endsWith(variables['Build.DefinitionName'], 'osx'), endsWith(variables['Build.DefinitionName'], 'outerloop')) }}: - - template: /eng/pipelines/macos.yml + - template: macos.yml parameters: isOfficialBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }} fullMatrix: ${{ notIn(variables['Build.Reason'], 'PullRequest') }} diff --git a/eng/pipelines/libraries/pre-publish.yml b/eng/pipelines/libraries/pre-publish.yml index 9d0460b..71752ad 100644 --- a/eng/pipelines/libraries/pre-publish.yml +++ b/eng/pipelines/libraries/pre-publish.yml @@ -7,7 +7,7 @@ stages: displayName: Pre-publish dependsOn: ${{ parameters.dependsOn }} jobs: - - template: ../common/templates/jobs/jobs.yml + - template: /eng/common/templates/jobs/jobs.yml parameters: enableMicrobuild: true enablePublishUsingPipelines: $(_PublishUsingPipelines) @@ -51,12 +51,12 @@ stages: artifactName: packages downloadPath: $(_artifactsDir) - - script: build.cmd + - script: $(buildScriptFileName).cmd -restore -ci displayName: Restore tools - - script: build.cmd + - script: $(buildScriptFileName).cmd -sign -ci -configuration $(_BuildConfig) @@ -64,7 +64,7 @@ stages: /p:OfficialBuildId=$(Build.BuildNumber) displayName: Sign packages - - script: build.cmd + - script: $(buildScriptFileName).cmd -publish -ci -configuration $(_BuildConfig) @@ -77,7 +77,7 @@ stages: /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/PublishToArtifacts.binlog displayName: Publish to artifacts and produce manifest - - script: powershell -ExecutionPolicy ByPass -NoProfile eng\common\msbuild.ps1 src\build.proj + - script: powershell -ExecutionPolicy ByPass -NoProfile eng\common\msbuild.ps1 $(sourcesRoot)/build.proj -warnaserror:0 -ci /t:UpdatePublishedVersions /p:GitHubAuthToken=$(AccessToken-dotnet-build-bot-public-repo) diff --git a/eng/pipelines/libraries/stress/http-linux.yml b/eng/pipelines/libraries/stress/http-linux.yml index c8c72ff..e2a8cb3 100644 --- a/eng/pipelines/libraries/stress/http-linux.yml +++ b/eng/pipelines/libraries/stress/http-linux.yml @@ -11,9 +11,13 @@ pool: name: Hosted Ubuntu 1604 variables: - httpStressProject: src/System.Net.Http/tests/StressTests/HttpStress - sdkBaseImage: sdk-corefx-current - httpStressImage: httpstress + - template: ../variables.yml + - name: httpStressProject + value: $(sourcesRoot)/System.Net.Http/tests/StressTests/HttpStress/ + - name: sdkBaseImage + value: sdk-corefx-current + - name: httpStressImage + value: httpstress steps: - checkout: self @@ -22,16 +26,16 @@ steps: lfs: false - bash: | - docker build -t $(sdkBaseImage) --build-arg CONFIGURATION=$(BUILD_CONFIGURATION) -f $(Build.SourcesDirectory)/$(HttpStressProject)/corefx.Dockerfile . + docker build -t $(sdkBaseImage) --build-arg CONFIGURATION=$(BUILD_CONFIGURATION) --build-arg BUILD_SCRIPT_NAME=$(buildScriptFileName) -f $(HttpStressProject)corefx.Dockerfile . displayName: Build Corefx - bash: | - cd '$(Build.SourcesDirectory)/$(HttpStressProject)' + cd '$(HttpStressProject)' docker build -t $(httpStressImage) --build-arg SDK_BASE_IMAGE=$(sdkBaseImage) --build-arg CONFIGURATION=$(BUILD_CONFIGURATION) . displayName: Build HttpStress - bash: | - cd '$(Build.SourcesDirectory)/$(HttpStressProject)' + cd '$(HttpStressProject)' docker-compose up --abort-on-container-exit --no-color displayName: Run HttpStress env: diff --git a/eng/pipelines/libraries/stress/http-windows.yml b/eng/pipelines/libraries/stress/http-windows.yml index cbac5e6..16f1550 100644 --- a/eng/pipelines/libraries/stress/http-windows.yml +++ b/eng/pipelines/libraries/stress/http-windows.yml @@ -11,7 +11,9 @@ pool: name: Hosted VS2017 variables: - httpStressProject: src/System.Net.Http/tests/StressTests/HttpStress/ + - template: ../variables.yml + - name: httpStressProject + value: $(sourcesRoot)/System.Net.Http/tests/StressTests/HttpStress/ steps: - checkout: self @@ -20,11 +22,11 @@ steps: lfs: false - powershell: | - .\build.cmd -ci -c $(BUILD_CONFIGURATION) + .\$(buildScriptFileName).cmd -ci -c $(BUILD_CONFIGURATION) displayName: Build Corefx - powershell: | - cd '$(Build.SourcesDirectory)/$(HttpStressProject)' + cd '$(HttpStressProject)' # Load testhost sdk in environment . .\load-corefx-testhost.ps1 -c $(BUILD_CONFIGURATION) -b # Run the stress suite diff --git a/eng/pipelines/libraries/variables.yml b/eng/pipelines/libraries/variables.yml new file mode 100644 index 0000000..e98b2eb --- /dev/null +++ b/eng/pipelines/libraries/variables.yml @@ -0,0 +1,17 @@ +variables: + - ${{ if contains(variables['Build.DefinitionName'], 'runtime') }}: # TODO: (Consolidation) Remove condition when consolidated + - name: buildScriptFileName + value: libraries + - name: sourcesRoot + value: $(Build.SourcesDirectory)/src/libraries + - name: pipelinesPath + value: /eng/pipelines/libraries + + # TODO: (Consolidation) Remove when consolidated + - ${{ if not(contains(variables['Build.DefinitionName'], 'runtime')) }}: + - name: buildScriptFileName + value: build + - name: sourcesRoot + value: $(Build.SourcesDirectory)/src + - name: pipelinesPath + value: /eng/pipelines diff --git a/eng/pipelines/libraries/windows.yml b/eng/pipelines/libraries/windows.yml index 9ad61b4..0763d36 100644 --- a/eng/pipelines/libraries/windows.yml +++ b/eng/pipelines/libraries/windows.yml @@ -126,7 +126,7 @@ stages: frameworkArg: -allConfigurations customBuildSteps: - - script: build.cmd + - script: $(buildScriptFileName).cmd -build -configuration $(_BuildConfig) -ci diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/corefx.Dockerfile b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/corefx.Dockerfile index 4039e02..17bcdec 100644 --- a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/corefx.Dockerfile +++ b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/corefx.Dockerfile @@ -8,7 +8,9 @@ WORKDIR /repo COPY . . ARG CONFIGURATION=Release -RUN ./build.sh -c $CONFIGURATION +# TODO: (Consolidation) remove when consolidated, change to ./libraries.sh +ARG BUILD_SCRIPT_NAME=build +RUN ./$BUILD_SCRIPT_NAME.sh -c $CONFIGURATION FROM $SDK_BASE_IMAGE as target