From 0417f54a3e2d97325717477c03cfc185094ca43b Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 25 Aug 2021 11:25:41 -0700 Subject: [PATCH] Installation check job file --- .../templates/jobs/installation.check.yml | 33 +++++++++++++++++ .../stages/archetype-java-release.yml | 37 +++---------------- 2 files changed, 38 insertions(+), 32 deletions(-) create mode 100644 eng/pipelines/templates/jobs/installation.check.yml diff --git a/eng/pipelines/templates/jobs/installation.check.yml b/eng/pipelines/templates/jobs/installation.check.yml new file mode 100644 index 0000000000000..6361ad901ea73 --- /dev/null +++ b/eng/pipelines/templates/jobs/installation.check.yml @@ -0,0 +1,33 @@ +parameters: + - name: Artifact + type: object + default: {} + - name: ArtifactName + type: string + default: "not-specified" + +jobs: + - job: InstallationCheck + displayName: "Installation Check" + variables: + - template: ../variables/globals.yml + steps: + - download: current + artifact: ${{parameters.ArtifactName}}-signed + - pwsh: | + Write-Host "Copy-Item $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/${{parameters.Artifact.groupId}}/${{parameters.Artifact.name}}/" "$(Pipeline.Workspace)/install-check-dir/${{parameters.Artifact.name}} -Recurse" + Copy-Item "${{parameters.ArtifactName}}-signed/${{parameters.Artifact.groupId}}/${{parameters.Artifact.name}}/" "install-check-dir/${{parameters.Artifact.name}}" -Recurse + Write-Host "$pomf = Get-ChildItem install-check-dir/${{parameters.Artifact.name}}/*.pom" + $pomf = Get-ChildItem install-check-dir/${{parameters.Artifact.name}}/*.pom + Write-Host "Rename-Item $($pomf) pom.xml" + Rename-Item $pomf pom.xml + Copy-Item "$(System.DefaultWorkingDirectory)/eng" "install-check-dir/${{ parameters.Artifact.name }}/eng" -Recurse + workingDirectory: $(Pipeline.Workspace) + displayName: "Copy Artifacts and Directories" + - template: /eng/pipelines/templates/steps/install-reporting-tools.yml + - task: Maven@3 + displayName: "Verify Package Installation" + inputs: + mavenPomFile: "$(Pipeline.Workspace)/install-check-dir/${{ parameters.Artifact.name }}/pom.xml" + options: "$(DefaultOptions) -Dcheckstyle.skip=true" + goals: "install" \ No newline at end of file diff --git a/eng/pipelines/templates/stages/archetype-java-release.yml b/eng/pipelines/templates/stages/archetype-java-release.yml index 2d4e04ba24554..7f74d756854c9 100644 --- a/eng/pipelines/templates/stages/archetype-java-release.yml +++ b/eng/pipelines/templates/stages/archetype-java-release.yml @@ -116,38 +116,11 @@ stages: PackageName: ${{artifact.name}} ServiceName: ${{parameters.ServiceDirectory}} ForRelease: true - - job: InstallationCheck - displayName: "Installation Check" - variables: - - template: ../variables/globals.yml - steps: - - download: current - artifact: ${{parameters.ArtifactName}}-signed - - pwsh: | - Copy-Item "$(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/${{artifact.groupId}}/${{artifact.name}}/" "$(Pipeline.Workspace)/install-check-dir/${{artifact.name}}" -Recurse - Write-Host "Copying artifact ${{artifact.name}}" - $pomf = Get-ChildItem $(Pipeline.Workspace)/install-check-dir/${{artifact.name}}/*.pom - Rename-Item "$($pomf)" pom.xml - Write-Host "Renaming $($pomf) to pom.xml" - Copy-Item "$(System.DefaultWorkingDirectory)/eng" "$(Pipeline.Workspace)/install-check-dir/${{ artifact.name }}/eng" -Recurse - displayName: "Copy Artifacts and Directories" - - task: Maven@3 - displayName: 'Install reporting tools' - inputs: - mavenPomFile: "$(Pipeline.Workspace)/install-check-dir/${{ artifact.name }}/eng/code-quality-reports/pom.xml" - options: "$(DefaultOptions)" - mavenOptions: "$(MemoryOptions) $(LoggingOptions)" - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.11' - jdkArchitectureOption: 'x64' - publishJUnitResults: false - goals: 'install' - - task: Maven@3 - displayName: "Maven Install" - inputs: - mavenPomFile: "$(Pipeline.Workspace)/install-check-dir/${{ artifact.name }}/pom.xml" - options: "$(DefaultOptions) -Dcheckstyle.skip=true" - goals: "install" + + - template: /eng/pipelines/templates/jobs/installation.check.yml + parameters: + Artifact: ${{ artifact }} + ArtifactName: ${{ parameters.ArtifactName }} - deployment: TagRepository displayName: "Create release tag"