Skip to content

Commit f973ffa

Browse files
committed
- moves pipeline steps in templates
1 parent 07bee6c commit f973ffa

8 files changed

Lines changed: 101 additions & 145 deletions

File tree

‎.azure-pipelines/buildAndPackage.yml‎

Lines changed: 8 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ trigger:
1414
include:
1515
- src/*
1616
exclude:
17+
- .gradle/wrapper
1718
- .gitignore
1819
- CONTRIBUTING.md
1920
- LICENSE
2021
- THIRD PARTY NOTICES
21-
- build.gradle
2222
- gradle.properties
2323
- gradlew
2424
- gradlew.bat
@@ -29,96 +29,12 @@ trigger:
2929
pr: none
3030

3131
pool:
32-
vmImage: 'windows-latest'
32+
vmImage: windows-latest
3333

3434
steps:
35-
- checkout: self
36-
clean: true
37-
fetchDepth: 1
38-
39-
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
40-
displayName: 'Run CredScan'
41-
inputs:
42-
debugMode: false
43-
44-
- pwsh: 'Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.2%2B7/OpenJDK15U-jdk_x64_windows_hotspot_15.0.2_7.zip -OutFile OpenJDK.zip'
45-
displayName: 'Download JDK'
46-
47-
- task: JavaToolInstaller@0
48-
inputs:
49-
versionSpec: '15'
50-
jdkArchitectureOption: 'x64'
51-
jdkSourceOption: 'LocalDirectory'
52-
jdkFile: 'OpenJDK.zip'
53-
jdkDestinationDirectory: 'binaries'
54-
55-
- task: DownloadSecureFile@1
56-
inputs:
57-
secureFile: 'local.properties'
58-
59-
- task: DownloadSecureFile@1
60-
inputs:
61-
secureFile: 'secring.gpg'
62-
63-
- task: DownloadSecureFile@1
64-
inputs:
65-
secureFile: 'secring.gpg.lock'
66-
67-
- task: CopyFiles@2
68-
inputs:
69-
SourceFolder: '$(Agent.TempDirectory)'
70-
Contents: '**'
71-
TargetFolder: '$(System.DefaultWorkingDirectory)'
72-
73-
- task: Gradle@2
74-
inputs:
75-
gradleWrapperFile: 'gradlew'
76-
tasks: 'build'
77-
publishJUnitResults: true
78-
testResultsFiles: '**/TEST-*.xml'
79-
javaHomeOption: 'JDKVersion'
80-
sonarQubeRunAnalysis: false
81-
82-
- task: PublishCodeCoverageResults@1
83-
inputs:
84-
codeCoverageTool: 'JaCoCo'
85-
summaryFileLocation: $(System.DefaultWorkingDirectory)/build/reports/jacoco/test/jacocoTestReport.xml
86-
pathToSources: $(System.DefaultWorkingDirectory)/src/main/java
87-
failIfCoverageEmpty: true
88-
89-
- task: PublishBuildArtifacts@1
90-
displayName: 'Publish Artifact: drop'
91-
inputs:
92-
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
93-
94-
- task: CopyFiles@2
95-
inputs:
96-
SourceFolder: '$(System.DefaultWorkingDirectory)'
97-
Contents: |
98-
**/libs/*
99-
build/generated-pom.xml
100-
build/generated-pom.xml.asc
101-
build.gradle
102-
gradlew
103-
gradlew.bat
104-
settings.gradle
105-
gradle.properties
106-
**/gradle/**
107-
Scripts/**
108-
TargetFolder: '$(Build.ArtifactStagingDirectory)/'
109-
110-
- task: PublishBuildArtifacts@1
111-
inputs:
112-
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
113-
ArtifactName: 'drop'
114-
publishLocation: 'Container'
115-
116-
- task: YodLabs.O365PostMessage.O365PostMessageBuild.O365PostMessageBuild@0
117-
displayName: 'Graph Client Tooling pipeline fail notification'
118-
inputs:
119-
addressType: serviceEndpoint
120-
serviceEndpointName: 'microsoftgraph pipeline status'
121-
title: '$(Build.DefinitionName) failure notification'
122-
text: 'This pipeline has failed. View the build details for further information. This is a blocking failure.'
123-
condition: and(failed(), ne(variables['Build.Reason'], 'Manual'))
124-
enabled: true
35+
- template: templates/checkout-and-credscan.yml
36+
- template: templates/install-java.yml
37+
- template: templates/secure-files.yml
38+
- template: templates/build-and-coverage.yml
39+
- template: templates/publish-artefacts.yml
40+
- template: templates/alert-failure.yml

‎.azure-pipelines/prValidate.yml‎

Lines changed: 8 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
pr:
77
branches:
88
include:
9-
- master
10-
- main
119
- dev
10+
- main
11+
- master
12+
- feature/v2
1213
paths:
1314
exclude:
14-
- .azure-pipelines
1515
- .gradle/wrapper
1616
- .gitignore
1717
- CONTRIBUTING.md
@@ -26,56 +26,11 @@ pr:
2626

2727
trigger: none # disable triggers based on commits.
2828

29-
variables:
30-
PACKAGE_NAME: 'microsoft-graph-core'
31-
PROPERTIES_PATH: '.\gradle.properties'
32-
33-
pool:
29+
pool:
3430
vmImage: windows-latest
3531

3632
steps:
37-
- checkout: self
38-
clean: true
39-
fetchDepth: 1
40-
41-
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
42-
displayName: 'Run CredScan'
43-
inputs:
44-
debugMode: false
45-
46-
- pwsh: 'Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.2%2B7/OpenJDK15U-jdk_x64_windows_hotspot_15.0.2_7.zip -OutFile OpenJDK.zip'
47-
displayName: 'Download JDK'
48-
49-
- task: JavaToolInstaller@0
50-
inputs:
51-
versionSpec: '15'
52-
jdkArchitectureOption: 'x64'
53-
jdkSourceOption: 'LocalDirectory'
54-
jdkFile: 'OpenJDK.zip'
55-
jdkDestinationDirectory: 'binaries'
56-
57-
- task: Gradle@2
58-
inputs:
59-
gradleWrapperFile: 'gradlew'
60-
tasks: 'build'
61-
publishJUnitResults: true
62-
testResultsFiles: '**/TEST-*.xml'
63-
javaHomeOption: 'JDKVersion'
64-
sonarQubeRunAnalysis: false
65-
66-
- task: PublishCodeCoverageResults@1
67-
inputs:
68-
codeCoverageTool: 'JaCoCo'
69-
summaryFileLocation: $(System.DefaultWorkingDirectory)/build/reports/jacoco/test/jacocoTestReport.xml
70-
pathToSources: $(System.DefaultWorkingDirectory)/src/main/java
71-
failIfCoverageEmpty: true
72-
73-
- task: YodLabs.O365PostMessage.O365PostMessageBuild.O365PostMessageBuild@0
74-
displayName: 'Graph Client Tooling pipeline fail notification'
75-
inputs:
76-
addressType: serviceEndpoint
77-
serviceEndpointName: 'microsoftgraph pipeline status'
78-
title: '$(Build.DefinitionName) failure notification'
79-
text: 'This pipeline has failed. View the build details for further information. This is a blocking failure. '
80-
condition: and(failed(), ne(variables['Build.Reason'], 'Manual'))
81-
enabled: true
33+
- template: templates/checkout-and-credscan.yml
34+
- template: templates/install-java.yml
35+
- template: templates/build-and-coverage.yml
36+
- template: templates/alert-failure.yml
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
steps:
2+
- task: YodLabs.O365PostMessage.O365PostMessageBuild.O365PostMessageBuild@0
3+
displayName: 'Graph Client Tooling pipeline fail notification'
4+
inputs:
5+
addressType: serviceEndpoint
6+
serviceEndpointName: 'microsoftgraph pipeline status'
7+
title: '$(Build.DefinitionName) failure notification'
8+
text: 'This pipeline has failed. View the build details for further information. This is a blocking failure. '
9+
condition: and(failed(), ne(variables['Build.Reason'], 'Manual'))
10+
enabled: true
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
steps:
2+
- task: Gradle@2
3+
inputs:
4+
gradleWrapperFile: 'gradlew'
5+
tasks: 'build'
6+
publishJUnitResults: true
7+
testResultsFiles: '**/TEST-*.xml'
8+
javaHomeOption: 'JDKVersion'
9+
sonarQubeRunAnalysis: false
10+
11+
- task: PublishCodeCoverageResults@1
12+
inputs:
13+
codeCoverageTool: 'JaCoCo'
14+
summaryFileLocation: $(System.DefaultWorkingDirectory)/build/reports/jacoco/test/jacocoTestReport.xml
15+
pathToSources: $(System.DefaultWorkingDirectory)/src/main/java
16+
failIfCoverageEmpty: true
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
steps:
2+
- checkout: self
3+
clean: true
4+
fetchDepth: 1
5+
6+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
7+
displayName: 'Run CredScan'
8+
inputs:
9+
debugMode: false
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
steps:
2+
- pwsh: 'Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.2%2B7/OpenJDK15U-jdk_x64_windows_hotspot_15.0.2_7.zip -OutFile OpenJDK.zip'
3+
displayName: 'Download JDK'
4+
5+
- task: JavaToolInstaller@0
6+
inputs:
7+
versionSpec: '15'
8+
jdkArchitectureOption: 'x64'
9+
jdkSourceOption: 'LocalDirectory'
10+
jdkFile: 'OpenJDK.zip'
11+
jdkDestinationDirectory: 'binaries'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
steps:
2+
- task: CopyFiles@2
3+
inputs:
4+
SourceFolder: '$(System.DefaultWorkingDirectory)'
5+
Contents: |
6+
**/libs/*
7+
build/generated-pom.xml
8+
build/generated-pom.xml.asc
9+
build.gradle
10+
gradlew
11+
gradlew.bat
12+
settings.gradle
13+
gradle.properties
14+
**/gradle/**
15+
Scripts/**
16+
TargetFolder: '$(Build.ArtifactStagingDirectory)/'
17+
18+
- task: PublishBuildArtifacts@1
19+
displayName: 'Publish Artifact: drop'
20+
inputs:
21+
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
steps:
2+
- task: DownloadSecureFile@1
3+
inputs:
4+
secureFile: 'local.properties'
5+
6+
- task: DownloadSecureFile@1
7+
inputs:
8+
secureFile: 'secring.gpg'
9+
10+
- task: DownloadSecureFile@1
11+
inputs:
12+
secureFile: 'secring.gpg.lock'
13+
14+
- task: CopyFiles@2
15+
inputs:
16+
SourceFolder: '$(Agent.TempDirectory)'
17+
Contents: '**'
18+
TargetFolder: '$(System.DefaultWorkingDirectory)'

0 commit comments

Comments
 (0)