Skip to content

Commit 585f834

Browse files
committed
single instance of secure-files using parameters
1 parent 8e6299d commit 585f834

File tree

4 files changed

+18
-27
lines changed

4 files changed

+18
-27
lines changed

.azure-pipelines/buildAndPackage.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ stages:
3333
steps:
3434
- template: templates/build/checkout-and-credscan.yml
3535
- template: templates/build/install-java.yml
36-
- template: templates/build/secure-files.yml
36+
- template: templates/secure-files.yml
37+
parameters:
38+
stageID: 'build'
3739
- template: templates/build/build-and-coverage.yml
3840
- template: templates/build/publish-artifacts.yml
3941
- template: templates/alert-failure.yml
@@ -44,7 +46,7 @@ stages:
4446
- job: Maven-Preview
4547
steps:
4648
- template: templates/download-artifacts.yml
47-
- template: templates/maven-preview/secure-files.yml
49+
- template: templates/secure-files.yml
4850
- template: templates/maven-preview/copy-and-build.yml
4951
- template: templates/alert-failure.yml
5052

@@ -60,7 +62,9 @@ stages:
6062
runOnce:
6163
deploy:
6264
steps:
63-
- template: templates/maven-release/secure-files.yml
65+
- template: templates/secure-files.yml
66+
parameters:
67+
stageID: 'release'
6468
- template: templates/maven-release/copy-and-build.yml
6569
- template: templates/alert-failure.yml
6670

.azure-pipelines/templates/maven-preview/secure-files.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.azure-pipelines/templates/maven-release/secure-files.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.azure-pipelines/templates/build/secure-files.yml renamed to .azure-pipelines/templates/secure-files.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
parameters:
2+
- name: stageID
3+
type: string
4+
default: ''
5+
16
steps:
2-
- task: DownloadSecureFile@1
3-
inputs:
4-
secureFile: 'local.properties'
5-
retryCount: '5'
7+
- task: DownloadSecureFile@1
8+
inputs:
9+
secureFile: 'local.properties'
10+
retryCount: '5'
611

12+
- ${{ if or(eq(parameters.stageID, 'build'), eq(parameters.stageID, 'release') }}:
713
- task: DownloadSecureFile@1
814
inputs:
915
secureFile: 'secring.gpg'
@@ -14,6 +20,7 @@ steps:
1420
secureFile: 'secring.gpg.lock'
1521
retryCount: '5'
1622

23+
- ${{ if eq(parameters.stageID, 'build') }}:
1724
- task: CopyFiles@2
1825
inputs:
1926
SourceFolder: '$(Agent.TempDirectory)'

0 commit comments

Comments
 (0)