From dc22e09e487b6e87d4b7c50ae93c28110d951e9f Mon Sep 17 00:00:00 2001 From: ramsessanchez Date: Mon, 23 Aug 2021 13:54:44 -0700 Subject: [PATCH] added DROP_PATH vairable to .yml, pass the variable to reqruied templates --- .azure-pipelines/buildAndPackage.yml | 8 ++++++++ .azure-pipelines/templates/copy-and-build.yml | 8 +++++--- .azure-pipelines/templates/download-artifacts.yml | 6 +++++- .azure-pipelines/templates/version-and-release.yml | 6 ++++-- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/buildAndPackage.yml b/.azure-pipelines/buildAndPackage.yml index 067bcc03185..123a21b892c 100644 --- a/.azure-pipelines/buildAndPackage.yml +++ b/.azure-pipelines/buildAndPackage.yml @@ -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 @@ -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: @@ -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) diff --git a/.azure-pipelines/templates/copy-and-build.yml b/.azure-pipelines/templates/copy-and-build.yml index 806617ed00f..62a415d275b 100644 --- a/.azure-pipelines/templates/copy-and-build.yml +++ b/.azure-pipelines/templates/copy-and-build.yml @@ -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 diff --git a/.azure-pipelines/templates/download-artifacts.yml b/.azure-pipelines/templates/download-artifacts.yml index c0b04da3611..29f5daf10e4 100644 --- a/.azure-pipelines/templates/download-artifacts.yml +++ b/.azure-pipelines/templates/download-artifacts.yml @@ -1,3 +1,7 @@ +parameters: +- name: directoryPath + type: string + steps: - download: none - task: DownloadPipelineArtifact@2 @@ -7,4 +11,4 @@ steps: itemPattern: | ** * - targetPath: '$(Agent.BuildDirectory)/Drop/' \ No newline at end of file + targetPath: '${{ parameters.directoryPath }}/' \ No newline at end of file diff --git a/.azure-pipelines/templates/version-and-release.yml b/.azure-pipelines/templates/version-and-release.yml index 63faa999989..4030e14550b 100644 --- a/.azure-pipelines/templates/version-and-release.yml +++ b/.azure-pipelines/templates/version-and-release.yml @@ -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