From 2f5f07e5d1fb537751a01182a239f90007d173b4 Mon Sep 17 00:00:00 2001
From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com>
Date: Tue, 15 Oct 2019 11:35:26 +0300
Subject: [PATCH] Update CI scripts and POM (#142)
* update search ci script
* update POM with direct dependencies
* Enable Java 11 Build
---
.../jobs/archetype-sdk-client-search.yml | 67 ++++++++++---------
sdk/search/azure-search/pom.xml | 28 +++++++-
2 files changed, 62 insertions(+), 33 deletions(-)
diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client-search.yml b/eng/pipelines/templates/jobs/archetype-sdk-client-search.yml
index 7c2cc2eb7525c..4161291ea9475 100644
--- a/eng/pipelines/templates/jobs/archetype-sdk-client-search.yml
+++ b/eng/pipelines/templates/jobs/archetype-sdk-client-search.yml
@@ -16,7 +16,7 @@ parameters:
# ProfileFlag: ''
# Windows - Java 8:
# OSName: 'Windows'
- # OSVmImage: 'vs2017-win2016'
+ # OSVmImage: 'windows-2019'
# JavaVersion: '1.8'
# ProfileFlag: ''
# Linux - Java LTS:
@@ -31,7 +31,7 @@ parameters:
# ProfileFlag: '-Djava-lts'
# Windows - Java LTS:
# OSName: 'Windows'
- # OSVmImage: 'vs2017-win2016'
+ # OSVmImage: 'windows-2019'
# JavaVersion: '1.11'
# ProfileFlag: '-Djava-lts'
@@ -50,23 +50,26 @@ jobs:
ArtifactName: 'packages'
ProfileFlag: ''
JavaVersion: '1.8'
- # Java LTS:
- # ArtifactName: 'java-lts-packages'
- # ProfileFlag: '-Djava-lts'
- # JavaVersion: '1.11'
+ Java LTS:
+ ArtifactName: 'java-lts-packages'
+ ProfileFlag: '-Djava-lts'
+ JavaVersion: '1.11'
steps:
- script: |
echo "##vso[build.addbuildtag]Scheduled"
displayName: 'Tag scheduled builds'
condition: and(eq(variables['Build.SourceBranchName'],'master'),eq(variables['Build.Reason'],'Schedule'))
+
+ - template: ../steps/cache-maven-repository.yml
+
- task: Maven@3
displayName: 'Build and Package'
inputs:
mavenPomFile: sdk/${{parameters.ServiceDirectory}}/pom.service.xml
goals: 'package'
options: '$(DefaultOptions) $(ProfileFlag) "-DpackageOutputDirectory=$(Build.ArtifactStagingDirectory)" -Dmaven.test.skip=true -Dinclude-template' # We include template-module so we ensure it always builds in CI
- mavenOptions: '$(LoggingOptions)'
+ mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(JavaVersion)
jdkArchitectureOption: 'x64'
@@ -78,6 +81,7 @@ jobs:
- job: 'Analyze'
+ condition: ne(variables['Skip.Analyze'], 'true')
variables:
- template: ../variables/globals.yml
@@ -97,6 +101,7 @@ jobs:
ward scan -d $(Build.SourcesDirectory) -c $(Build.SourcesDirectory)/eng/.docsettings.yml
displayName: 'Verify Readmes'
enabled: false
+
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
# ComponentGovernance is currently unable to run on pull requests of public projects. Running on non-PR
# builds should be sufficient.
@@ -110,14 +115,26 @@ jobs:
- template: ../steps/install-reporting-tools.yml
parameters:
Options: --batch-mode
- MavenOptions: $(LoggingOptions)
+ MavenOptions: $(MemoryOptions) $(LoggingOptions)
+
+ - task: Maven@3
+ displayName: 'Install azure-sdk-parent'
+ inputs:
+ mavenPomFile: parent/pom.xml
+ options: '$(DefaultOptions) -DskipTests -Dgpg.skip'
+ mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
+ javaHomeOption: 'JDKVersion'
+ jdkVersionOption: '1.11'
+ jdkArchitectureOption: 'x64'
+ publishJUnitResults: false
+ goals: 'install'
- task: Maven@3
displayName: 'Install all client libraries (for SpotBugs analysis)'
inputs:
mavenPomFile: pom.client.xml
options: '$(DefaultOptions) -Djava-lts -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true $(MavenScopeDown)'
- mavenOptions: '$(LoggingOptions)'
+ mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
@@ -141,12 +158,11 @@ jobs:
# running as a PR check.
- task: Maven@3
displayName: 'Generate Maven project site, including JavaDocs, SpotBugs, and CheckStyle reports'
- condition: ne(variables['Build.Reason'], 'PullRequest')
enabled: false
inputs:
mavenPomFile: pom.client.xml
options: '$(DefaultOptions) -Djava-lts -DskipTests -Dgpg.skip'
- mavenOptions: '$(LoggingOptions)'
+ mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
@@ -154,15 +170,14 @@ jobs:
goals: 'install site:site site:stage'
# We run a separate SpotBugs aggregate report step here to roll-up all the issues identified per-module in the
- # previous step. This is only generated in non-PR builds (i.e. nightly runs, etc)
+ # previous step.
- task: Maven@3
displayName: 'Run SpotBugs'
- condition: ne(variables['Build.Reason'], 'PullRequest')
enabled: false
inputs:
mavenPomFile: eng/spotbugs-aggregate-report/pom.xml
options: '--batch-mode -Djava-lts -DskipTests -Dgpg.skip'
- mavenOptions: '$(LoggingOptions)'
+ mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
@@ -173,24 +188,13 @@ jobs:
git clone https://github.com/JonathanGiles/DependencyChecker.git
mkdir input && cp dependencies.json input/
displayName: 'Download dependency checker'
- - task: Maven@3
- displayName: 'Install azure-sdk-parent'
- inputs:
- mavenPomFile: parent/pom.xml
- options: '$(DefaultOptions) -DskipTests -Dgpg.skip'
- mavenOptions: '$(LoggingOptions)'
- javaHomeOption: 'JDKVersion'
- jdkVersionOption: '1.11'
- jdkArchitectureOption: 'x64'
- publishJUnitResults: false
- goals: 'install'
- task: Maven@3
displayName: 'Analyze dependencies'
inputs:
mavenPomFile: 'DependencyChecker/pom.xml'
options: '-Dexec.args="-showall -dependencymanagement"'
- mavenOptions: '$(LoggingOptions)'
+ mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
@@ -198,7 +202,7 @@ jobs:
goals: 'clean package exec:java'
# We only copy artifacts into the staging in nightly builds, we don't bother with this for PR validation builds.
- - powershell: |
+ - pwsh: |
copy -r target/staging $(Build.ArtifactStagingDirectory)
copy eng/code-quality-reports/src/main/resources/index.html $(Build.ArtifactStagingDirectory)
copy eng/spotbugs-aggregate-report/target/spotbugs/spotbugsXml.html (Join-Path $(Build.ArtifactStagingDirectory) "staging")
@@ -206,6 +210,7 @@ jobs:
displayName: 'Copy reports to artifact staging'
condition: ne(variables['Build.Reason'], 'PullRequest')
enabled: false
+
- publish: $(Build.ArtifactStagingDirectory)
condition: succeededOrFailed()
displayName: 'Publish Report Artifacts'
@@ -227,13 +232,15 @@ jobs:
parameters:
OSName: $(OSName)
+ - template: ../steps/cache-maven-repository.yml
+
- task: Maven@3
displayName: 'Start Jetty'
condition: ne(variables['SdkType'], 'client')
inputs:
mavenPomFile: pom.client.xml
options: '$(DefaultOptions) $(ProfileFlag)'
- mavenOptions: '$(LoggingOptions)'
+ mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(JavaVersion)
jdkArchitectureOption: 'x64'
@@ -247,7 +254,7 @@ jobs:
inputs:
mavenPomFile: sdk/${{parameters.ServiceDirectory}}/pom.service.xml
options: ${{ parameters.TestOptions }}
- mavenOptions: '-Xmx3072m $(LoggingOptions)'
+ mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(JavaVersion)
jdkArchitectureOption: 'x64'
@@ -258,4 +265,4 @@ jobs:
condition: succeededOrFailed()
inputs:
mergeTestResults: true
- testRunTitle: '$(OSName) on Java $(JavaVersion)'
\ No newline at end of file
+ testRunTitle: '$(OSName) on Java $(JavaVersion)'
diff --git a/sdk/search/azure-search/pom.xml b/sdk/search/azure-search/pom.xml
index aca395fbe25ca..04dd13e49c463 100644
--- a/sdk/search/azure-search/pom.xml
+++ b/sdk/search/azure-search/pom.xml
@@ -57,6 +57,18 @@
1.0.0-preview.6
compile
+
+ org.apache.commons
+ commons-lang3
+
+
+ io.projectreactor
+ reactor-core
+
+
+ com.microsoft.azure
+ azure-client-runtime
+
@@ -79,14 +91,24 @@
com.microsoft.azure
- azure-client-runtime
+ azure
+ 1.24.1
+ test
com.microsoft.azure
- azure
- 1.24.1
+ azure-client-authentication
test
+
+ com.microsoft.azure
+ azure-mgmt-search
+ 1.24.1
+
+
+ com.microsoft.azure
+ azure-mgmt-resources
+