From da5f3e694c1c3f0715eb27d8a8b2c1afd5af7623 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Mon, 23 Aug 2021 10:50:57 -0700 Subject: [PATCH 1/6] Update copy-and-build.yml --- .azure-pipelines/templates/copy-and-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/templates/copy-and-build.yml b/.azure-pipelines/templates/copy-and-build.yml index 0ae9f5d55..99cdb8cdb 100644 --- a/.azure-pipelines/templates/copy-and-build.yml +++ b/.azure-pipelines/templates/copy-and-build.yml @@ -8,12 +8,12 @@ steps: inputs: SourceFolder: '$(Agent.TempDirectory)' Contents: '**' - TargetFolder: '$(Agent.BuildDirectory)/Drop/' + TargetFolder: '$(DROP_PATH)/' - task: Gradle@2 inputs: - gradleWrapperFile: $(Agent.BuildDirectory)/Drop/gradlew - workingDirectory: '$(Agent.BuildDirectory)/Drop/' + gradleWrapperFile: $(DROP_PATH)/gradlew + workingDirectory: '$(DROP_PATH)/' options: '-x jar -x javadoc -x javadocJar -x compileJava -x processResources -x classes -x sourceJar' tasks: ${{ parameters.task }} publishJUnitResults: true From 85158ca37467525e990102a1a4cef486e40413ca Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Mon, 23 Aug 2021 10:52:06 -0700 Subject: [PATCH 2/6] Update download-artifacts.yml --- .azure-pipelines/templates/download-artifacts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/download-artifacts.yml b/.azure-pipelines/templates/download-artifacts.yml index dfc62df72..b26e8ac30 100644 --- a/.azure-pipelines/templates/download-artifacts.yml +++ b/.azure-pipelines/templates/download-artifacts.yml @@ -4,7 +4,7 @@ steps: inputs: source: current artifact: Drop - path: '$(Agent.BuildDirectory)/Drop/' + path: '$(DROP_PATH)/' patterns: | ** - * \ No newline at end of file + * From 57bb58c08b5a51274d9b04c3b983ec160ae84b73 Mon Sep 17 00:00:00 2001 From: ramsessanchez Date: Mon, 23 Aug 2021 13:21:06 -0700 Subject: [PATCH 3/6] added Drop_path varaible to YML, pass vairable to templates --- .azure-pipelines/buildAndPackage.yml | 12 ++++++++++++ .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, 26 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/buildAndPackage.yml b/.azure-pipelines/buildAndPackage.yml index 0092324b9..8745de1ae 100644 --- a/.azure-pipelines/buildAndPackage.yml +++ b/.azure-pipelines/buildAndPackage.yml @@ -32,6 +32,9 @@ pr: pool: vmImage: windows-latest +variables: + DROP_PATH: '$(Agent.BuildDirectory)/Drop' + stages: - stage: Build jobs: @@ -57,11 +60,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: [] @@ -76,6 +82,8 @@ stages: deploy: steps: - template: templates/download-artifacts.yml + parameters: + directoryPath: $(DROP_PATH) - template: templates/install-java.yml - template: templates/secure-files.yml parameters: @@ -83,6 +91,7 @@ stages: - template: templates/copy-and-build.yml parameters: task: 'publishMavenCentralReleasePublicationToSonatypeRepository' + directoryPath: $(DROP_PATH) - deployment: Github_Release dependsOn: Maven_Release @@ -94,6 +103,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 99cdb8cdb..0be87a212 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: '$(DROP_PATH)/' + TargetFolder: '$${{ parameters.directoryPath }}/' - task: Gradle@2 inputs: - gradleWrapperFile: $(DROP_PATH)/gradlew - workingDirectory: '$(DROP_PATH)/' + 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 b26e8ac30..ecd6d7d9e 100644 --- a/.azure-pipelines/templates/download-artifacts.yml +++ b/.azure-pipelines/templates/download-artifacts.yml @@ -1,10 +1,14 @@ +parameters: +- name: directoryPath + type: string + steps: - download: none - task: DownloadPipelineArtifact@2 inputs: source: current artifact: Drop - path: '$(DROP_PATH)/' + path: '${{ parameters.directoryPath }}/' patterns: | ** * diff --git a/.azure-pipelines/templates/version-and-release.yml b/.azure-pipelines/templates/version-and-release.yml index 78597aeb9..a3a2ce213 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 From a9c71d78b0be203e375c3cf3ade524a7be9d75be Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Mon, 23 Aug 2021 13:23:54 -0700 Subject: [PATCH 4/6] Update copy-and-build.yml --- .azure-pipelines/templates/copy-and-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/copy-and-build.yml b/.azure-pipelines/templates/copy-and-build.yml index 0be87a212..bec712abc 100644 --- a/.azure-pipelines/templates/copy-and-build.yml +++ b/.azure-pipelines/templates/copy-and-build.yml @@ -14,8 +14,8 @@ steps: - task: Gradle@2 inputs: - gradleWrapperFile: $${{ parameters.directoryPath }}/gradlew - workingDirectory: '$${{ parameters.directoryPath }}/' + 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 From 553d794f3a01b98a90d767ae7f0b183a89fd224e Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Mon, 23 Aug 2021 13:24:17 -0700 Subject: [PATCH 5/6] Update copy-and-build.yml --- .azure-pipelines/templates/copy-and-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/copy-and-build.yml b/.azure-pipelines/templates/copy-and-build.yml index bec712abc..787fe1a6f 100644 --- a/.azure-pipelines/templates/copy-and-build.yml +++ b/.azure-pipelines/templates/copy-and-build.yml @@ -10,7 +10,7 @@ steps: inputs: SourceFolder: '$(Agent.TempDirectory)' Contents: '**' - TargetFolder: '$${{ parameters.directoryPath }}/' + TargetFolder: '${{ parameters.directoryPath }}/' - task: Gradle@2 inputs: From 7696fb9e610d684dfb1d0ef776b56e37a395e2a0 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Mon, 23 Aug 2021 13:24:46 -0700 Subject: [PATCH 6/6] Update version-and-release.yml --- .azure-pipelines/templates/version-and-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/version-and-release.yml b/.azure-pipelines/templates/version-and-release.yml index a3a2ce213..92eb32359 100644 --- a/.azure-pipelines/templates/version-and-release.yml +++ b/.azure-pipelines/templates/version-and-release.yml @@ -8,8 +8,8 @@ parameters: steps: - task: PowerShell@2 inputs: - filePath: '$${{ parameters.directoryPath }}/Scripts/getLatestVersion.ps1' - arguments: '-propertiesPath "$${{ parameters.directoryPath }}/gradle.properties"' + filePath: '${{ parameters.directoryPath }}/Scripts/getLatestVersion.ps1' + arguments: '-propertiesPath "${{ parameters.directoryPath }}/gradle.properties"' pwsh: true - task: GitHubRelease@1