-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable caching of local maven repository
- Normalize the maven options across the pipelines - Use json/ps to produce artifact list instead of yml
- Loading branch information
1 parent
4464c9f
commit 4eb0da5
Showing
14 changed files
with
85 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
steps: | ||
- script: | | ||
echo "##vso[task.setvariable variable=Maven.RepositoryPath;]%USERPROFILE%\.m2\repository" | ||
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) | ||
displayName: Detecting Maven repository on Windows | ||
- script: | | ||
echo "##vso[task.setvariable variable=Maven.RepositoryPath;]$HOME/.m2/repository" | ||
condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT')) | ||
displayName: Detecting Maven repository on Linux and macOS | ||
- task: CacheBeta@0 | ||
- task: Cache@2 | ||
inputs: | ||
key: $(Agent.JobName)|$(CacheSalt)|$(Build.SourcesDirectory)/sdk/**/pom.xml|$(Build.SourcesDirectory)/pom*.xml | ||
path: $(Maven.RepositoryPath) | ||
displayName: 'Download/upload cache' | ||
condition: and(succeeded(), ne(variables['EnableCaching'], 'false')) | ||
key: 'maven | $(CacheSalt) | $(Agent.OS) | $(Build.SourcesDirectory)/eng/versioning/external_dependencies.txt' | ||
path: $(MAVEN_CACHE_FOLDER) | ||
displayName: Cache Maven local repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,28 @@ | ||
# This job template uses the artifact list in the ci.yml file | ||
# to generate a variable at build time that can be passed into | ||
# the Maven -pl command-line switch to constrain what subset of | ||
# projects are targetted based on the artifacts this pipeline | ||
# projects are targeted based on the artifacts this pipeline | ||
# produces. The -am and -amd switches are then applied as | ||
# appropriate to constrain the full graph that is built depending | ||
# on whether we are doing a recorded test play back or a full live | ||
# test. | ||
|
||
steps: | ||
- template: ../steps/cache-maven-repository.yml | ||
|
||
- pwsh: | | ||
Write-Host "##vso[task.setvariable variable=ProjectList;]" | ||
displayName: Initialize project list variable | ||
$artifacts = '${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | ||
$additionalModules = '${{ convertToJson(parameters.AdditionalModules) }}' | ConvertFrom-Json | ||
# These artifacts are the principal outputs of the build. We source | ||
# them from the artifact list. | ||
- ${{each artifact in parameters.Artifacts }}: | ||
- pwsh: | | ||
Write-Host "##vso[task.setvariable variable=ProjectList;]$(ProjectList),${{artifact.groupId}}:${{artifact.name}}" | ||
displayName: Append ${{artifact.groupId}}:${{artifact.name}} to project list | ||
$projectList = @() | ||
foreach ($artifact in $artifacts) { | ||
$projectList += "$($artifact.groupId):$($artifact.name)" | ||
} | ||
foreach ($artifact in $additionalModules) { | ||
$projectList += "$($artifact.groupId):$($artifact.name)" | ||
} | ||
$projects = $projectList -join ',' | ||
# From time to time we might need to also build another module which | ||
# we don't actually want to ship, so we list that here. We can't rely | ||
# on the -amd switch to do this since is doesn't resolve dependencies | ||
# AFTER dependents have been resolved, which means some projects might | ||
# be missing from the resulting build graph. This works around that | ||
# limitation in Maven. | ||
- ${{each artifact in parameters.AdditionalModules }}: | ||
- pwsh: | | ||
Write-Host "##vso[task.setvariable variable=ProjectList;]$(ProjectList),${{artifact.groupId}}:${{artifact.name}}" | ||
displayName: Append ${{artifact.groupId}}:${{artifact.name}} to project list | ||
Write-Host "ProjectList = $projects" | ||
Write-Host "##vso[task.setvariable variable=ProjectList;]$projects" | ||
displayName: Initialize project list variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
variables: | ||
DocWardenVersion: '0.7.1' | ||
WagonOptions: '-Dmaven.wagon.rto=300000 -Dmaven.wagon.http.retryHandler.count=3' | ||
DefaultOptions: '--batch-mode --fail-at-end --settings eng/settings.xml $(WagonOptions)' | ||
LoggingOptions: '-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' | ||
MemoryOptions: '-Xmx3072m' | ||
#Agent.Source.Git.ShallowFetchDepth: 1 | ||
skipComponentGovernanceDetection: true | ||
AdditionalOptions: '' | ||
# format !<group1Id>:<artifact1Id>, !<group2Id>:<artifact2Id>,... no trailing comma is necessary | ||
PLSkipOptions: '' | ||
# This is the default Java build version. It's the version used to build the shipping libraries, Spotbugs etc. | ||
JavaBuildVersion: '1.11' | ||
# This is the default Java test version. It's the version used when running tests. | ||
JavaTestVersion: '1.11' | ||
|
||
# Maven build/test options | ||
MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository | ||
# See https://github.com/actions/virtual-environments/issues/1499 for more info about the wagon options | ||
WagonOptions: '-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120' | ||
DefaultOptions: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) --batch-mode --fail-at-end --settings eng/settings.xml $(WagonOptions)' | ||
LoggingOptions: '-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' | ||
MemoryOptions: '-Xmx3072m' | ||
DefaultTestOptions: '$(DefaultOptions) -Dgpg.skip -Dmaven.javadoc.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -DtrimStackTrace=false -pl $(ProjectList)' | ||
DefaultTestMavenOptions: '$(MemoryOptions) $(LoggingOptions)' | ||
AdditionalOptions: '' | ||
|
||
skipComponentGovernanceDetection: true | ||
IsDebug: $[coalesce(variables['System.Debug'], 'false')] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters