Skip to content

Commit

Permalink
added DROP_PATH vairable to .yml, pass the variable to reqruied templ…
Browse files Browse the repository at this point in the history
…ates
  • Loading branch information
ramsessanchez committed Aug 23, 2021
1 parent 303a5d1 commit dc22e09
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .azure-pipelines/buildAndPackage.yml
Expand Up @@ -54,11 +54,14 @@ stages:
deploy:
steps:
- template: templates/download-artifacts.yml
parameters:
directoryPath: $(DROP_PATH)
- template: templates/install-java.yml
- template: templates/secure-files.yml
- template: templates/copy-and-build.yml
parameters:
task: 'publishSnapshotPublicationToSonatypeSnapshotRepository'
directoryPath: $(DROP_PATH)

- stage: Maven_Release_And_Github_Release
dependsOn: Build
Expand All @@ -73,6 +76,8 @@ stages:
deploy:
steps:
- template: templates/download-artifacts.yml
parameters:
directoryPath: $(DROP_PATH)
- template: templates/install-java.yml
- template: templates/secure-files.yml
parameters:
Expand All @@ -91,6 +96,9 @@ stages:
deploy:
steps:
- template: templates/download-artifacts.yml
parameters:
directoryPath: $(DROP_PATH)
- template: templates/version-and-release.yml
parameters:
gitConnection: 'microsoftgraphrelease'
directoryPath: $(DROP_PATH)
8 changes: 5 additions & 3 deletions .azure-pipelines/templates/copy-and-build.yml
Expand Up @@ -2,18 +2,20 @@ parameters:
- name: task
type: string
default: ''
- name: directoryPath
type: string

steps:
- task: CopyFiles@2
inputs:
SourceFolder: '$(Agent.TempDirectory)'
Contents: '**'
TargetFolder: '$(Agent.BuildDirectory)/Drop/'
TargetFolder: '${{ parameters.directoryPath }}/'

- task: Gradle@2
inputs:
gradleWrapperFile: '$(Agent.BuildDirectory)/Drop/gradlew'
workingDirectory: '$(Agent.BuildDirectory)/Drop/'
gradleWrapperFile: '${{ parameters.directoryPath }}/gradlew'
workingDirectory: '${{ parameters.directoryPath }}/'
options: '-x jar -x javadoc -x javadocJar -x compileJava -x processResources -x classes -x sourceJar'
tasks: ${{ parameters.task }}
publishJUnitResults: true
Expand Down
6 changes: 5 additions & 1 deletion .azure-pipelines/templates/download-artifacts.yml
@@ -1,3 +1,7 @@
parameters:
- name: directoryPath
type: string

steps:
- download: none
- task: DownloadPipelineArtifact@2
Expand All @@ -7,4 +11,4 @@ steps:
itemPattern: |
**
*
targetPath: '$(Agent.BuildDirectory)/Drop/'
targetPath: '${{ parameters.directoryPath }}/'
6 changes: 4 additions & 2 deletions .azure-pipelines/templates/version-and-release.yml
Expand Up @@ -2,12 +2,14 @@ parameters:
- name: gitConnection
type: string
default: ''
- name: directoryPath
type: string

steps:
- task: PowerShell@2
inputs:
filePath: '$(DROP_PATH)/Scripts/getLatestVersion.ps1'
arguments: '-propertiesPath "$(DROP_PATH)/gradle.properties"'
filePath: '${{ parameters.directoryPath }}/Scripts/getLatestVersion.ps1'
arguments: '-propertiesPath "${{ parameters.directoryPath }}/gradle.properties"'
pwsh: true

- task: GitHubRelease@1
Expand Down

0 comments on commit dc22e09

Please sign in to comment.