Download Latest Master artifacts (#4786)

* Download Latest Master artifacts
This commit is contained in:
KarishmaGhiya 2019-09-03 12:11:47 -07:00 коммит произвёл GitHub
Родитель f5e1f9824b
Коммит dcd9a29b08
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 87 добавлений и 1 удалений

Просмотреть файл

@ -80,7 +80,7 @@ jobs:
path: $(Build.ArtifactStagingDirectory) path: $(Build.ArtifactStagingDirectory)
- job: "Analyze" - job: "Analyze"
dependsOn: "Build"
variables: variables:
- template: ../variables/globals.yml - template: ../variables/globals.yml
@ -94,6 +94,37 @@ jobs:
parameters: parameters:
ServiceDirectory: ${{parameters.ServiceDirectory}} ServiceDirectory: ${{parameters.ServiceDirectory}}
- task: DownloadPipelineArtifact@2
inputs:
buildType: "current"
artifactName: packages
itemPattern: "*.tgz"
targetPath: "$(Agent.TempDirectory)/packagesCurrent"
displayName: "Download Current Build artifacts"
- task: DownloadPipelineArtifact@2
inputs:
buildType: "specific"
project: "29ec6040-b234-4e31-b139-33dc4287b756" #guid for public project
definition: 614 #system.definitionId for js - client -ci
buildVersionToDownload: "latest"
branchName: "master"
artifactName: packages
itemPattern: "*.tgz"
targetPath: "$(Agent.TempDirectory)/packagesMaster"
displayName: "Download Latest Master (PipelineTask) artifacts"
- pwsh: eng/tools/compare-packages.ps1 "$(Agent.TempDirectory)/packagesMaster" "$(Agent.TempDirectory)/packagesCurrent" "$(Build.BuildNumber)" "$(System.ArtifactsDirectory)"
displayName: "Diff Generated Packages"
errorActionPreference: "continue"
- task: PublishPipelineArtifact@1
condition: succeededOrFailed()
displayName: "Publish Report Artifacts"
inputs:
artifactName: package-diffs
path: $(Build.ArtifactStagingDirectory)
- script: | - script: |
pip install setuptools wheel pip install setuptools wheel
pip install doc-warden pip install doc-warden
@ -171,9 +202,11 @@ jobs:
- script: | - script: |
node common/scripts/install-run-rush.js build --verbose node common/scripts/install-run-rush.js build --verbose
displayName: "Build libraries" displayName: "Build libraries"
- script: | - script: |
node common/scripts/install-run-rush.js build:test --verbose node common/scripts/install-run-rush.js build:test --verbose
displayName: "Build test assets" displayName: "Build test assets"
- script: | - script: |
node common/scripts/install-run-rush.js unit-test --verbose $(GeneratedPackageTargetsFrom) node common/scripts/install-run-rush.js unit-test --verbose $(GeneratedPackageTargetsFrom)
displayName: "Test libraries" displayName: "Test libraries"

Просмотреть файл

@ -0,0 +1,53 @@
param (
$pathToMasterPkg,
$pathToCurrentPkg,
$dailyDevBuildNo,
$pathForDiffFile
)
function ExtractTGZPackages($pathToPkg) {
$parentExtractDir = Join-Path $pathToPkg "all-contents"
Write-Host "mkdir $parentExtractDir"
mkdir $parentExtractDir
foreach ($p in $(dir $pathToPkg -r -i *.tgz)) {
if($p.BaseName -match "(?<name>.*?)(-\d+\.\d+\.\d+.*)") {
$extractDir = Join-Path $parentExtractDir $matches["name"]
mkdir "$extractDir"
pushd "$extractDir"
tar -xzf $p.FullName
popd
if($LastExitCode -ne 0) {
Write-Host "error >> tar -xzf $p.FullName failed with exit code $LastExitCode"
}
}
else {
write-error "Package name $($p.BaseName) doesn't match the expected format [<name>-<version>]!"
}
}
}
try {
$extractMasterDir = Join-Path $pathToMasterPkg "all-contents"
ExtractTGZPackages($pathToMasterPkg)
$extractCurrentDir = Join-Path $pathToCurrentPkg "all-contents"
ExtractTGZPackages($pathToCurrentPkg)
Write-Host "Finished unzipping of all .tgz packages"
$diffFile = Join-Path $pathForDiffFile "Change_$dailyDevBuildNo.diff"
Write-Host "created filename variable $diffFile"
git diff $extractMasterDir $extractCurrentDir | tee $diffFile
if($LastExitCode -ne 0) {
Write-Host "error >> git diff $extractMasterDir $extractCurrentDir | tee $diffFile executes with exit code $LastExitCode"
}
Write-Host "created the diff file - $diffFile"
exit 0
}
catch {
Write-Host "An error occurred:"
Write-Host $_
}