Skip to content

Commit b59737b

Browse files
authored
Fix release pipeline (#1574)
* Copy bits to 3.0.3-BETA.2-HEYA-TEST container on azure blob * Add more logs * Add check to download 64bit or 32bit 7-Zip * Add a check to install 64bit vs. 32bit azcopy * Install 3rd party softwares to D drive * Don't use 7-Zip to unzip azcopy * Add a new param called JarPath * Clean up * Revert Version back to 3.0.3-BETA.2
1 parent c93a11a commit b59737b

File tree

5 files changed

+24
-55
lines changed

5 files changed

+24
-55
lines changed

.scripts/copyBitsToAzureBlob.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ param (
77
[ValidateNotNullOrEmpty()]
88
[string]$ServicePrincipleClientId,
99

10+
[Parameter(Mandatory=$true, HelpMessage="Jar location")]
11+
[ValidateNotNullOrEmpty()]
12+
[string]$JarPath,
13+
1014
[Parameter(Mandatory=$true, HelpMessage="applicationinsights-java version")]
1115
[ValidateNotNullOrEmpty()]
1216
[string]$SDKVersionNumber
1317
)
1418

19+
Write-Host "Jar path: $JarPath"
1520
$Env:AZCOPY_SPA_CLIENT_SECRET=$ServicePrincipalKey
1621
azcopy login --service-principal --application-id $ServicePrincipleClientId
17-
azcopy copy "$(System.DefaultWorkingDirectory)/_applicationinsights-java-Windows-Official-master/drop/outputs/build/Artifacts/agent/agent/build/libs/applicationinsights-agent-$SDKVersionNumber.jar" "https://azuresdkpartnerdrops.blob.core.windows.net/drops/applicationinsights-sdk/java/$SDKVersionNumber/"
22+
azcopy copy "$JarPath/applicationinsights-agent-$SDKVersionNumber.jar" "https://azuresdkpartnerdrops.blob.core.windows.net/drops/applicationinsights-sdk/java/$SDKVersionNumber/"
1823
Remove-Item Env:AZCOPY_SPA_CLIENT_SECRET

.scripts/generateVersion.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ $date = Get-Date -UFormat "%Y%m%d"
1212
$revision = "$date$env:CDP_DEFINITION_BUILD_COUNT_DAY"
1313
$buildNumber = "$major.$minor.$patch.$revision"
1414
[Environment]::SetEnvironmentVariable("CustomBuildNumber", $buildNumber, "User") # This will allow you to use it from env var in later steps of the same phase
15-
Write-Host "##vso[build.updatebuildnumber]${buildNumber}"
15+
Write-Host "##vso[build.updatebuildnumber]${buildNumber}"

.scripts/install-azcopy.ps1

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -49,32 +49,11 @@ try
4949
}
5050
}
5151

52-
if ($SkipUnzip)
52+
if (-not $SkipUnzip)
5353
{
54-
if($Destination.ToString() -eq "C:\7-Zip") {
55-
Start-Process -Wait -FilePath "$Source" -ArgumentList "/S"
56-
}
57-
}
58-
else
59-
{
60-
if ($PathTo7Zip)
61-
{
62-
Write-Host "***"
63-
Write-Host $PathTo7Zip.ToString()
64-
Write-Host "***"
65-
if (-not (Test-Path $PathTo7Zip))
66-
{
67-
Write-Error "7zip location still does not exist $PathTo7Zip"
68-
exit
69-
}
70-
Expand-ArchiveWith7Zip -Source $Source -Destination $destination -ToolPath $PathTo7Zip
71-
}
72-
else
73-
{
74-
Write-Host "$PathTo7Zip does not exist"
75-
Expand-ArchiveWith7Zip -Source $Source -Destination $destination
76-
}
77-
Write-Host "Finished unzipping to $destination"
54+
Write-Host "Unzipping $Source to $Destination"
55+
Expand-Archive -LiteralPath $Source -Destination $Destination -Force
56+
Write-Host "Finished unzipping to $Destination"
7857
}
7958
}
8059
finally

.scripts/install7zipexe.cmd

Lines changed: 0 additions & 20 deletions
This file was deleted.

.scripts/installAzCopyV10.cmd

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22

33
echo "Installing AzCopy V10 Windows..."
44

5-
set ZIP_URL=https://azcopyvnext.azureedge.net/release20210226/azcopy_windows_amd64_10.9.0.zip
5+
set ZIP_URL_64=https://azcopyvnext.azureedge.net/release20210226/azcopy_windows_amd64_10.9.0.zip
6+
set ZIP_URL_32=https://azcopyvnext.azureedge.net/release20210226/azcopy_windows_386_10.9.0.zip
7+
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT
68

7-
powershell -NoProfile -ExecutionPolicy Unrestricted -File "%~dp0install-azcopy.ps1" -Url "%ZIP_URL%" -Destination "C:\Program Files\AzCopy" -UpdatePath -PathTo7Zip "C:\7-Zip\7z.exe" -CleanOnFinish || exit /B 1
9+
if %OS%==64BIT (
10+
powershell -NoProfile -ExecutionPolicy Unrestricted -File "%~dp0install-azcopy.ps1" -Url "%ZIP_URL_64%" -Destination "C:\Program Files\AzCopy" -UpdatePath -CleanOnFinish || exit /B 1
11+
) else (
12+
powershell -NoProfile -ExecutionPolicy Unrestricted -File "%~dp0install-azcopy.ps1" -Url "%ZIP_URL_32%" -Destination "C:\Program Files\AzCopy" -UpdatePath -CleanOnFinish || exit /B 1
13+
)
814

9-
echo "C:\Program Files\AzCopy"
10-
dir "C:\Program Files\AzCopy"
15+
IF EXIST "C:\Program Files\AzCopy\azcopy_windows_amd64_10.9.0\azcopy.exe" (
16+
echo "AzCopy v10.9.0 was installed Successfully."
17+
) ELSE (
18+
echo "ERROR: Failed to install AzCopy v10.9.0."
19+
)
1120

12-
echo "C:\Program Files\AzCopy\azcopy_windows_amd64_10.9.0"
13-
dir "C:\Program Files\AzCopy\azcopy_windows_amd64_10.9.0"
14-
15-
echo "Installed AzCopy v10.9.0 Successfully."

0 commit comments

Comments
 (0)