-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Migrate java pipelines to 1es pipeline templates #39243
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
Changes from all commits
b5ddc7e
175e7c7
6c6e44b
8e3ad12
93e97d3
7cf9b94
92f5c6c
abc44c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,8 @@ jobs: | |
| Repositories: | ||
| - Name: $(DocRepoOwner)/$(DocRepoName) | ||
| WorkingDirectory: $(DocRepoLocation) | ||
| - Name: azure-sdk/$(DocRepoName) | ||
| WorkingDirectory: $(DailyDocRepoLocation) | ||
|
Comment on lines
+30
to
+31
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JimSuplizio, need an ack here that this change to perform a single sparse checkout is valid
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be functionally equivalent |
||
| # Pull and build the docker image. | ||
| - template: /eng/common/pipelines/templates/steps/docker-pull-image.yml | ||
| parameters: | ||
|
|
@@ -94,17 +96,6 @@ jobs: | |
| - template: /eng/common/pipelines/templates/steps/set-daily-docs-branch-name.yml | ||
| parameters: | ||
| DailyBranchVariableName: DailyDocsBranchName | ||
| - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml | ||
| parameters: | ||
| SkipCheckoutNone: true | ||
| Paths: | ||
| - package.json | ||
| - metadata/ | ||
| - docs-ref-mapping/reference-unified.yml | ||
| - docs-ref-services/ | ||
| Repositories: | ||
| - Name: azure-sdk/$(DocRepoName) | ||
| WorkingDirectory: $(DailyDocRepoLocation) | ||
|
|
||
| # Docs daily updates is supposed to download packages from public feed repository, so we have to specify additional repositories in a POM or the profile. | ||
| # Here is maven documentation: https://maven.apache.org/guides/mini/guide-multiple-repositories.html | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,82 +9,94 @@ pr: | |
| - eng/pipelines/latest-jdk.yml | ||
| - eng/scrips/Install-Latest-JDK.ps1 | ||
|
|
||
| variables: | ||
| - template: /eng/pipelines/templates/variables/globals.yml | ||
|
|
||
| stages: | ||
| - stage: LatestJdk | ||
| displayName: Latest JDK | ||
|
|
||
| jobs: | ||
| - job: RunLatestJdk | ||
| displayName: Run Latest JDK | ||
| timeoutInMinutes: 180 | ||
|
|
||
| pool: | ||
| name: 'azsdk-pool-mms-ubuntu-2004-general' | ||
| vmImage: 'MMSUbuntu20.04' | ||
|
|
||
| steps: | ||
| # Skip sparse checkout for the `azure-sdk-for-<lang>-pr` private mirrored repositories | ||
| # as we require the GitHub service connection to be loaded. | ||
| - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: | ||
| - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml | ||
| parameters: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This YML can be deleted as there is logic for each ci.yml and tests.yml to run an additional job for latest JDK (when it isn't an LTS version)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @alzimmermsft so should we delete this whole pipeline then? https://dev.azure.com/azure-sdk/internal/_build?definitionId=5710 |
||
| - name: Artifacts | ||
| type: object | ||
| default: | ||
| - name: latest-jdk # fake artifact name | ||
| groupId: run # fake group id | ||
|
|
||
| extends: | ||
| template: /eng/pipelines/templates/stages/1es-redirect.yml | ||
| parameters: | ||
| UseOfficial: false | ||
| stages: | ||
| - stage: LatestJdk | ||
| variables: | ||
| - template: /eng/pipelines/templates/variables/globals.yml | ||
| - template: /eng/pipelines/templates/variables/image.yml | ||
| - name: ArtifactsJson | ||
| value: '${{ convertToJson(parameters.Artifacts) }}' | ||
|
|
||
| displayName: Latest JDK | ||
|
|
||
| jobs: | ||
| - job: RunLatestJdk | ||
| displayName: Run Latest JDK | ||
| timeoutInMinutes: 180 | ||
|
|
||
| pool: | ||
| name: $(LINUXPOOL) | ||
| image: $(LINUXVMIMAGE) | ||
| os: linux | ||
|
|
||
| steps: | ||
| # Skip sparse checkout for the `azure-sdk-for-<lang>-pr` private mirrored repositories | ||
| # as we require the GitHub service connection to be loaded. | ||
| - ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}: | ||
| - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml | ||
| parameters: | ||
| Paths: | ||
| - '**/*.xml' | ||
|
|
||
| - task: UsePythonVersion@0 | ||
| displayName: 'Use Python $(PythonVersion)' | ||
| inputs: | ||
| versionSpec: $(PythonVersion) | ||
|
|
||
| - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml | ||
| parameters: | ||
| JobType: 'LatestJdk' | ||
|
|
||
| - task: PythonScript@0 | ||
| displayName: 'Generate FromSource POM and directories for sparse checkout' | ||
| inputs: | ||
| scriptPath: 'eng/scripts/generate_from_source_pom.py' | ||
| arguments: '--match-any-version --set-skip-linting-projects SkipLintingProjects --artifacts-list com.azure:azure-core' | ||
| workingDirectory: '$(System.DefaultWorkingDirectory)' | ||
|
|
||
| - template: /eng/pipelines/templates/steps/sparse-checkout-repo-initialized.yml | ||
| parameters: | ||
| SkipCheckoutNone: true | ||
| Paths: $(SparseCheckoutDirectories) | ||
|
|
||
| - template: /eng/pipelines/templates/steps/install-reporting-tools.yml | ||
|
|
||
| - pwsh: | | ||
| Write-Host "##vso[task.setvariable variable=IsLatestNonLtsJdk;]true" | ||
|
|
||
| - template: /eng/pipelines/templates/steps/install-latest-jdk.yml | ||
| parameters: | ||
| Paths: | ||
| - '**/*.xml' | ||
|
|
||
| - task: UsePythonVersion@0 | ||
| displayName: 'Use Python $(PythonVersion)' | ||
| inputs: | ||
| versionSpec: $(PythonVersion) | ||
|
|
||
| - template: /eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml | ||
| parameters: | ||
| JobType: 'LatestJdk' | ||
| Artifacts: | ||
| - name: latest-jdk # fake artifact name | ||
| groupId: run # fake group id | ||
|
|
||
| - task: PythonScript@0 | ||
| displayName: 'Generate FromSource POM and directories for sparse checkout' | ||
| inputs: | ||
| scriptPath: 'eng/scripts/generate_from_source_pom.py' | ||
| arguments: '--match-any-version --set-skip-linting-projects SkipLintingProjects --artifacts-list com.azure:azure-core' | ||
| workingDirectory: '$(System.DefaultWorkingDirectory)' | ||
|
|
||
| - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml | ||
| parameters: | ||
| SkipCheckoutNone: true | ||
| Paths: $(SparseCheckoutDirectories) | ||
|
|
||
| - template: /eng/pipelines/templates/steps/install-reporting-tools.yml | ||
|
|
||
| - pwsh: | | ||
| Write-Host "##vso[task.setvariable variable=IsLatestNonLtsJdk;]true" | ||
|
|
||
| - template: /eng/pipelines/templates/steps/install-latest-jdk.yml | ||
| parameters: | ||
| LatestJdkFeatureVersion: $(LatestNonLtsJdkFeatureVersion) | ||
|
|
||
| - task: Maven@3 | ||
| displayName: 'Run All Libraries Latest JDK' | ||
| inputs: | ||
| mavenPomFile: ClientFromSourcePom.xml | ||
| options: '$(DefaultOptions) -T 1C -Dgpg.skip' | ||
| mavenOptions: '$(MemoryOptions) $(LoggingOptions)' | ||
| javaHomeOption: 'JDKVersion' | ||
| jdkVersionOption: $(LatestNonLtsJavaVersion) | ||
| jdkArchitectureOption: 'x64' | ||
| publishJUnitResults: false | ||
| goals: 'clean install' | ||
| continueOnError: true | ||
|
|
||
| - task: PublishTestResults@2 | ||
| condition: always() | ||
| inputs: | ||
| testResultsFormat: 'JUnit' | ||
| testResultsFiles: '**/TEST-*.xml' | ||
| searchFolder: '$(System.DefaultWorkingDirectory)/sdk' | ||
| mergeTestResults: true | ||
| testRunTitle: '$(Agent.JobName)_attempt_$(System.JobAttempt)' | ||
| LatestJdkFeatureVersion: $(LatestNonLtsJdkFeatureVersion) | ||
|
|
||
| - task: Maven@3 | ||
| displayName: 'Run All Libraries Latest JDK' | ||
| inputs: | ||
| mavenPomFile: ClientFromSourcePom.xml | ||
| options: '$(DefaultOptions) -T 1C -Dgpg.skip' | ||
| mavenOptions: '$(MemoryOptions) $(LoggingOptions)' | ||
| javaHomeOption: 'JDKVersion' | ||
| jdkVersionOption: $(LatestNonLtsJavaVersion) | ||
| jdkArchitectureOption: 'x64' | ||
| publishJUnitResults: false | ||
| goals: 'clean install' | ||
| continueOnError: true | ||
|
|
||
| - task: PublishTestResults@2 | ||
| condition: always() | ||
| inputs: | ||
| testResultsFormat: 'JUnit' | ||
| testResultsFiles: '**/TEST-*.xml' | ||
| searchFolder: '$(System.DefaultWorkingDirectory)/sdk' | ||
| mergeTestResults: true | ||
| testRunTitle: '$(Agent.JobName)_attempt_$(System.JobAttempt)' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Captures any .hprof files in the build directory and moves them to a staging directory for artifact publishing. | ||
|
|
||
| .DESCRIPTION | ||
| This script is used to capture any .hprof files in the build directory and move them to a staging directory for | ||
| artifact publishing. It also sets a pipeline variable to indicate whether any .hprof files were found. | ||
|
|
||
| .PARAMETER StagingDirectory | ||
| The directory where the .hprof files will be moved to. | ||
|
|
||
| .PARAMETER OomArtifactName | ||
| The name of the artifact to be created. | ||
| #> | ||
|
|
||
| param( | ||
| [Parameter(Mandatory = $true)] | ||
| [string]$StagingDirectory, | ||
|
|
||
| [Parameter(Mandatory = $true)] | ||
| [string]$OomArtifactName | ||
| ) | ||
|
|
||
| $hrpofs = Get-ChildItem -Path . -Recurse -Filter *.hprof -File | ||
|
|
||
| if ($hrpofs.Count -gt 0) { | ||
| if (-not (Test-Path "$StagingDirectory/troubleshooting")) { | ||
| New-Item -ItemType Directory -Path "$StagingDirectory/troubleshooting" | Out-Null | ||
| } | ||
| Compress-Archive -Path $hrpofs -DestinationPath "$StagingDirectory/troubleshooting/$OomArtifactName.zip" | ||
| Write-Host "##vso[task.setvariable variable=HAS_TROUBLESHOOTING]true" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be deleted as it has been rolled up into the
troubleshootingartifact.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't touched this pipeline yet (see no templateContext either)