Skip to content

Commit

Permalink
Update CI scripts and POM (Azure#142)
Browse files Browse the repository at this point in the history
* update search ci script
* update POM with direct dependencies
* Enable Java 11 Build
  • Loading branch information
tamirkamara authored Oct 15, 2019
1 parent 2b90ac1 commit 2f5f07e
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 33 deletions.
67 changes: 37 additions & 30 deletions eng/pipelines/templates/jobs/archetype-sdk-client-search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ parameters:
# ProfileFlag: ''
# Windows - Java 8:
# OSName: 'Windows'
# OSVmImage: 'vs2017-win2016'
# OSVmImage: 'windows-2019'
# JavaVersion: '1.8'
# ProfileFlag: ''
# Linux - Java LTS:
Expand All @@ -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'

Expand All @@ -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'
Expand All @@ -78,6 +81,7 @@ jobs:


- job: 'Analyze'
condition: ne(variables['Skip.Analyze'], 'true')

variables:
- template: ../variables/globals.yml
Expand All @@ -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.
Expand All @@ -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'
Expand All @@ -141,28 +158,26 @@ 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'
publishJUnitResults: false
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'
Expand All @@ -173,39 +188,29 @@ 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'
publishJUnitResults: false
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")
copy output/dependencies.html (Join-Path $(Build.ArtifactStagingDirectory) "staging")
displayName: 'Copy reports to artifact staging'
condition: ne(variables['Build.Reason'], 'PullRequest')
enabled: false
- publish: $(Build.ArtifactStagingDirectory)
condition: succeededOrFailed()
displayName: 'Publish Report Artifacts'
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -258,4 +265,4 @@ jobs:
condition: succeededOrFailed()
inputs:
mergeTestResults: true
testRunTitle: '$(OSName) on Java $(JavaVersion)'
testRunTitle: '$(OSName) on Java $(JavaVersion)'
28 changes: 25 additions & 3 deletions sdk/search/azure-search/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@
<version>1.0.0-preview.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-runtime</artifactId>
</dependency>

<!-- Test dependencies -->
<dependency>
Expand All @@ -79,14 +91,24 @@
<!-- Test dependencies for creating search resources -->
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-runtime</artifactId>
<artifactId>azure</artifactId>
<version>1.24.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure</artifactId>
<version>1.24.1</version>
<artifactId>azure-client-authentication</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-search</artifactId>
<version>1.24.1</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-resources</artifactId>
</dependency>

</dependencies>

Expand Down

0 comments on commit 2f5f07e

Please sign in to comment.