Skip to content

Commit 8793b7d

Browse files
committed
add DROP_PATH into .yml variable, pass it into templates as DirectoryPath param
1 parent 1c55fee commit 8793b7d

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

.azure-pipelines/buildAndPackage.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ pr:
2929
pool:
3030
vmImage: windows-latest
3131

32+
variables:
33+
DROP_PATH: '$(Agent.BuildDirectory)/Drop'
34+
3235
stages:
3336
- stage: Build
3437
jobs:
@@ -54,9 +57,13 @@ stages:
5457
deploy:
5558
steps:
5659
- template: templates/download-artifacts.yml
60+
parameters:
61+
directoryPath: $(DROP_PATH)
5762
- template: templates/install-java.yml
5863
- template: templates/secure-files.yml
5964
- template: templates/copy-and-build.yml
65+
parameters:
66+
directoryPath: $(DROP_PATH)
6067

6168
- deployment: Github_Release
6269
dependsOn: Maven_Preview
@@ -68,6 +75,9 @@ stages:
6875
deploy:
6976
steps:
7077
- template: templates/download-artifacts.yml
78+
parameters:
79+
directoryPath: $(DROP_PATH)
7180
- template: templates/version-and-release.yml
7281
parameters:
7382
gitConnection: 'microsoftgraphrelease'
83+
directoryPath: $(DROP_PATH)

.azure-pipelines/templates/copy-and-build.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
parameters:
2+
- name: directoryPath
3+
type: string
4+
15
steps:
26
- task: CopyFiles@2
37
inputs:
48
SourceFolder: '$(Agent.TempDirectory)'
59
Contents: '**'
6-
TargetFolder: '$(DROP_PATH)/'
10+
TargetFolder: '${{ parameters.directoryPath }}/'
711

812
- task: Gradle@2
913
inputs:
10-
gradleWrapperFile: '$(DROP_PATH)/gradlew'
11-
workingDirectory: '$(DROP_PATH)/'
14+
gradleWrapperFile: '${{ parameters.directoryPath }}/gradlew'
15+
workingDirectory: '${{ parameters.directoryPath }}/'
1216
options: '-x jar -x javadoc -x javadocJar -x compileJava -x processResources -x classes -x sourceJar'
1317
tasks: 'publishSnapshotPublicationToSonatypeSnapshotRepository'
1418
publishJUnitResults: true

.azure-pipelines/templates/download-artifacts.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
parameters:
2+
- name: directoryPath
3+
type: string
4+
15
steps:
26
- download: none
37
- task: DownloadPipelineArtifact@2
@@ -7,4 +11,4 @@ steps:
711
itemPattern: |
812
**
913
*
10-
targetPath: '$(DROP_PATH)/'
14+
targetPath: '${{ parameters.directoryPath }}/'

.azure-pipelines/templates/version-and-release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ parameters:
22
- name: gitConnection
33
type: string
44
default: ''
5+
- name: directoryPath
6+
type: string
57

68
steps:
79
- task: PowerShell@2
810
inputs:
9-
filePath: '$(DROP_PATH)/Scripts/getLatestVersion.ps1'
10-
arguments: '-propertiesPath "$(DROP_PATH)/gradle.properties"'
11+
filePath: '${{ parameters.directoryPath }}/Scripts/getLatestVersion.ps1'
12+
arguments: '-propertiesPath "${{ parameters.directoryPath }}/gradle.properties"'
1113
pwsh: true
1214

1315
- task: GitHubRelease@1

0 commit comments

Comments
 (0)